コード例 #1
0
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        public static IList <Page> Get(this IPageOperations operations,
                                       string locationId,
                                       bool isContinous = false)
        {
            //return new ActiveList<Page>
            //{
            //    _Pages = Task
            //    .Factory
            //    .StartNew(s => ((IPageOperations)s).GetAsync(locationId, beginTime, endTime, listOrder, limit), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
            //    .Unwrap()
            //    .GetAwaiter()
            //    .GetResult(),
            //};

            var task = Task.Run(() => operations.GetWithHttpMessagesAsync(locationId, null));

            task.Wait();

            return(new ActiveList <Page>
            {
                InitialUri = task.Result.Request.RequestUri.AbsoluteUri,
                Collection = task.Result.Body,
                NextUri = task.Result.ToNextUri(),
                Operations = operations,
                IsContinous = isContinous,
            });
        }
コード例 #2
0
 private void InitSubApis()
 {
     this.userOperations      = new UserTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.placesOperations    = new PlacesTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.friendOperations    = new FriendTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.feedOperations      = new FeedTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.groupOperations     = new GroupTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.commentOperations   = new CommentTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.likeOperations      = new LikeTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.eventOperations     = new EventTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.mediaOperations     = new MediaTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.pageOperations      = new PageTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.fqlOperations       = new FqlTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.questionOperations  = new QuestionTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
     this.openGraphOperations = new OpenGraphTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
 }
コード例 #3
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <Page> > GetAsync(this IPageOperations operations,
                                                   string locationId,
                                                   bool isContinous = false,
                                                   CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var result = await operations.GetWithHttpMessagesAsync(locationId, null, cancellationToken).ConfigureAwait(false))
     {
         return(new ActiveList <Page>
         {
             InitialUri = result.Request.RequestUri.AbsoluteUri,
             Collection = result.Body,
             NextUri = result.ToNextUri(),
             Operations = operations,
             IsContinous = isContinous,
             CancellationToken = cancellationToken,
         });
     }
 }
コード例 #4
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static void Post(this IPageOperations operations, string locationId, Page value)
 {
     Task.Factory.StartNew(s => ((IPageOperations)s).PostAsync(locationId, value), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
コード例 #5
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='value'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PutAsync(this IPageOperations operations, string locationId, string id, Page value, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PutWithHttpMessagesAsync(locationId, id, value, null, cancellationToken).ConfigureAwait(false);
 }
コード例 #6
0
		private void InitSubApis()
		{
			this.userOperations      = new UserTemplate     (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.placesOperations    = new PlacesTemplate   (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.friendOperations    = new FriendTemplate   (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.feedOperations      = new FeedTemplate     (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.groupOperations     = new GroupTemplate    (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.commentOperations   = new CommentTemplate  (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.likeOperations      = new LikeTemplate     (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.eventOperations     = new EventTemplate    (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.mediaOperations     = new MediaTemplate    (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.pageOperations      = new PageTemplate     (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.fqlOperations       = new FqlTemplate      (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.questionOperations  = new QuestionTemplate (this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
			this.openGraphOperations = new OpenGraphTemplate(this.applicationNamespace, this.RestTemplate, this.IsAuthorized);
		}