~ubuntu-branches/debian/squeeze/f-spot/squeeze

« back to all changes in this revision

Viewing changes to extensions/Exporters/FacebookExport/Mono.Facebook/Event.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Mirco Bauer, Iain Lane
  • Date: 2009-02-07 20:23:32 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20090207202332-oc93rfjo1st0571s
Tags: 0.5.0.3-2
[ Mirco Bauer]
* Upload to unstable.
* debian/control:
  + Lowered GNOME# build-deps to 2.0 ABI as that transition didn't happen
    yet in unstable.

[ Iain Lane ]
* debian/patches/svn-r4545_locales-import.dpatch: Patch backported from SVN
  trunk revision 4545 - initialize the translation catalog earlier (LP: #293305)
  (Closes: #514457). Thanks to Florian Heinle for finding the patch and to
  Chris Coulson for preparing the update.
* debian/control: Build-depend on libmono-dev (>= 1.2.4) to match configure
  checks.
* debian/rules: Pass CSC=/usr/bin/csc to configure for gio-sharp to fix FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Mono.Facebook.Event.cs:
 
3
// // Authors:
 
4
//      George Talusan (george@convolve.ca)
 
5
//
 
6
 
 
7
// Permission is hereby granted, free of charge, to any person obtaining
 
8
// a copy of this software and associated documentation files (the
 
9
// "Software"), to deal in the Software without restriction, including
 
10
// without limitation the rights to use, copy, modify, merge, publish,
 
11
// distribute, sublicense, and/or sell copies of the Software, and to
 
12
// permit persons to whom the Software is furnished to do so, subject to
 
13
// the following conditions:
 
14
//
 
15
// The above copyright notice and this permission notice shall be
 
16
// included in all copies or substantial portions of the Software.
 
17
//
 
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
19
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
20
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
21
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 
22
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 
23
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
24
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
25
//
 
26
using System;
 
27
using System.Collections.Generic;
 
28
using System.IO;
 
29
using System.Xml.Serialization;
 
30
using System.Text;
 
31
 
 
32
namespace Mono.Facebook
 
33
{
 
34
        public class EventMemberList
 
35
        {
 
36
                public Friend[] Attending;
 
37
 
 
38
                public Friend[] Unsure;
 
39
 
 
40
                public Friend[] Declined;
 
41
 
 
42
                public Friend[] NotReplied;
 
43
        }
 
44
 
 
45
        public class Event : SessionWrapper
 
46
        {
 
47
                [XmlElement ("eid")]
 
48
                public long EId;
 
49
 
 
50
                [XmlElement ("name")]
 
51
                public string Name;
 
52
 
 
53
                [XmlElement ("tagline")]
 
54
                public string Tagline;
 
55
 
 
56
                [XmlElement ("nid")]
 
57
                public long NId;
 
58
 
 
59
                [XmlElement ("pic")]
 
60
                public string Pic;
 
61
 
 
62
                [XmlIgnore ()]
 
63
                public Uri PicUri
 
64
                {
 
65
                        get { return new Uri (Pic); }
 
66
                }
 
67
 
 
68
                [XmlElement ("pic_big")]
 
69
                public string PicBig;
 
70
 
 
71
                [XmlIgnore ()]
 
72
                public Uri PicBigUri
 
73
                {
 
74
                        get { return new Uri (PicBig); }
 
75
                }
 
76
 
 
77
                [XmlElement ("pic_small")]
 
78
                public string PicSmall;
 
79
 
 
80
                [XmlIgnore ()]
 
81
                public Uri PicSmallUri
 
82
                {
 
83
                        get { return new Uri (PicSmall); }
 
84
                }
 
85
 
 
86
                [XmlElement ("host")]
 
87
                public string Host;
 
88
 
 
89
                [XmlElement ("description")]
 
90
                public string Description;
 
91
 
 
92
                [XmlElement ("event_type")]
 
93
                public string EventType;
 
94
 
 
95
                [XmlElement ("event_subtype")]
 
96
                public string EventSubType;
 
97
 
 
98
                [XmlElement ("start_time")]
 
99
                public long StartTime;
 
100
 
 
101
                [XmlElement ("end_time")]
 
102
                public long EndTime;
 
103
 
 
104
                [XmlElement ("creator")]
 
105
                public long? Creator;
 
106
 
 
107
                [XmlElement ("update_time")]
 
108
                public long UpdateTime;
 
109
 
 
110
                [XmlElement ("location")]
 
111
                public string Location;
 
112
 
 
113
                [XmlElement ("venue")]
 
114
                public Location Venue;
 
115
 
 
116
                [XmlIgnore ()]
 
117
                public EventMemberList MemberList {
 
118
                        get {
 
119
                                EventMembersResponse rsp = Session.Util.GetResponse<EventMembersResponse> ("facebook.events.getMembers",
 
120
                                        FacebookParam.Create ("session_key", Session.SessionKey),
 
121
                                        FacebookParam.Create ("call_id", DateTime.Now.Ticks),
 
122
                                        FacebookParam.Create ("eid", EId));
 
123
 
 
124
                                EventMemberList list = new EventMemberList ();
 
125
 
 
126
                                list.Attending = new Friend [rsp.Attending.UIds.Length];
 
127
                                for (int i = 0; i < list.Attending.Length; i++)
 
128
                                        list.Attending[i] = new Friend (rsp.Attending.UIds [i], this.Session);
 
129
 
 
130
                                list.Unsure = new Friend [rsp.Unsure.UIds.Length];
 
131
                                for (int i = 0; i < list.Unsure.Length; i++)
 
132
                                        list.Unsure [i] = new Friend (rsp.Unsure.UIds [i], this.Session);
 
133
 
 
134
                                list.Declined = new Friend [rsp.Declined.UIds.Length];
 
135
                                for (int i = 0; i < list.Declined.Length; i ++)
 
136
                                        list.Declined [i] = new Friend (rsp.Declined.UIds [i], this.Session);
 
137
 
 
138
                                list.NotReplied = new Friend [rsp.NotReplied.UIds.Length];
 
139
 
 
140
                                return list;
 
141
                        }
 
142
 
 
143
                }
 
144
        }
 
145
}