コード例 #1
0
        public static List<Schemas.Rest.@event> GetEvents(this Facebook facebook, string userId, string[] eventIds, int? startTime, int? endTime, RsvpStatus? rsvpStatus, IDictionary<string, string> parameters)
        {
            if (parameters == null)
                parameters = new Dictionary<string, string>();

            if (!string.IsNullOrEmpty(userId))
                parameters.Add("uid", userId);

            var eids = FacebookUtils.ToCommaSeperatedValues(eventIds);

            if (!string.IsNullOrEmpty(eids))
                parameters.Add("eids", eids);

            if (startTime != null)
                parameters.Add("start_time", startTime.Value.ToString());

            if (endTime != null)
                parameters.Add("end_time", endTime.Value.ToString());

            if (rsvpStatus != null)
                parameters.Add("rsvp_status", FacebookUtils.ToString(rsvpStatus.Value));

            var result = facebook.GetUsingRestApi("events.get", parameters);

            return result.Equals("{}", StringComparison.OrdinalIgnoreCase)
                       ? new List<Schemas.Rest.@event>()
                       : FacebookUtils.DeserializeObject<List<Schemas.Rest.@event>>(result);
        }
コード例 #2
0
		public Invitation(string eventId, string name, DateTime startTime, DateTime endTime, RsvpStatus rsvpStatus)
		{
			this.EventId    = eventId;
			this.Name       = name;
			this.StartTime  = startTime;
			this.EndTime    = endTime;
			this.RsvpStatus = rsvpStatus;
		}
コード例 #3
0
        private static RsvpStatus RsvpStatusDeserializer(JsonValue json)
        {
            RsvpStatus value = RsvpStatus.UNSURE;

            if (json != null && !json.IsNull)
            {
                try
                {
                    string code = json.GetValue <string>();
                    code  = code.ToUpper();
                    value = (RsvpStatus)Enum.Parse(typeof(RsvpStatus), code);
                }
                catch
                {
                }
            }
            return(value);
        }
コード例 #4
0
        public static string ToString(RsvpStatus rsvpStatus)
        {
            switch (rsvpStatus)
            {
            case RsvpStatus.Attending:
                return("attending");

            case RsvpStatus.Unsure:
                return("unsure");

            case RsvpStatus.Declined:
                return("declined");

            case RsvpStatus.NotReplied:
                return("not_replied");

            default:
                throw new ArgumentOutOfRangeException("rsvpStatus");
            }
        }
コード例 #5
0
		public EventInvitee(String id, String name, RsvpStatus rsvpStatus)
		{
			this.ID         = id;
			this.Name       = name;
			this.RsvpStatus = rsvpStatus;
		}
コード例 #6
0
 public EventInvitee(String id, String name, RsvpStatus rsvpStatus)
 {
     this.ID         = id;
     this.Name       = name;
     this.RsvpStatus = rsvpStatus;
 }
コード例 #7
0
 public Invitation(string eventId, string name, DateTime startTime, DateTime endTime, RsvpStatus rsvpStatus, string location)
 {
     this.EventId    = eventId;
     this.Name       = name;
     this.StartTime  = startTime;
     this.EndTime    = endTime;
     this.Location   = location;
     this.RsvpStatus = rsvpStatus;
 }