예제 #1
0
        public async Task CreateSheetPacket()
        {
            IPlanGridApi client = PlanGridClient.Create();
            Page <Sheet> sheets = await client.GetSheets(TestData.Project2Uid);

            ShareableObject packetRequest = await client.CreateSheetPacket(TestData.Project2Uid, new SheetPacketRequest
            {
                SheetUids = new[] { sheets.Data[0].Uid }
            });

            for (int i = 0;; i++)
            {
                ShareableObject obj = await client.GetSheetPacket(TestData.Project2Uid, packetRequest.Uid);

                if (obj.Status == Status.Incomplete)
                {
                    if (i == 10)
                    {
                        Assert.Fail("Timed out after 10 seconds trying to get the packet.");
                    }
                    else
                    {
                        await Task.Delay(1000);
                    }
                }
                else
                {
                    var get = new HttpClient();
                    HttpResponseMessage response = await get.GetAsync(obj.FileUrl);

                    Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
                    break;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Show the UI to share informations on social networks
        /// </summary>
        /// <param name="element">Contains informations to share</param>
        public static void Share(ShareableObject element)
        {
            ShareTaskBase task = new ShareLinkTask
            {
                Title   = element.Title,
                Message = element.Message,
                LinkUri = element.Uri
            };

            task.Show();
        }
예제 #3
0
        /// <summary>
        /// Display the Share UI
        /// </summary>
        /// <param name="conference">Conference converted in a generic object to share</param>
        private void Share(ShareableObject conference)
        {
            try
            {
                DataTransferManager.GetForCurrentView().DataRequested -= ConferencesPage_DataRequested;
            }
            finally
            {
                _shareContractFactory = new ShareContractFactory((ShareableWin8Object)conference);
                DataTransferManager.GetForCurrentView().DataRequested += ConferencesPage_DataRequested;
            }

            DataTransferManager.ShowShareUI();
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ShareableObject shareableObject = null;

            if (value is News)
            {
                News news = value as News;

                shareableObject = new ShareableObject
                {
                    Title   = news.Title,
                    Message = news.ShortText,
                    Uri     = new Uri(string.Format(AppResources.WEBSITE_FORMAT, AppResources.PAGE_NEWS, news.Id, news.Url))
                };
            }
            else if (value is Conference)
            {
                Conference conference = value as Conference;

                shareableObject = new ShareableObject
                {
                    Title   = conference.Name,
                    Message = string.Format(AppResources.FORMAT_CONFERENCE, conference.Start_DateTime, conference.End_DateTime, conference.Place),
                    Uri     = new Uri(string.Format(AppResources.WEBSITE_FORMAT, AppResources.PAGE_CONFERENCES, conference.Id, conference.Url))
                };
            }
            else if (value is Show)
            {
                Show salon = value as Show;

                shareableObject = new ShareableObject
                {
                    Title   = salon.Name,
                    Message = string.Format(AppResources.FORMAT_SALON, salon.Start_DateTime, salon.End_DateTime, salon.Place),
                    Uri     = new Uri(string.Format(AppResources.WEBSITE_FORMAT, AppResources.PAGE_SALONS, salon.Id, salon.Url))
                };
            }

            return(shareableObject);
        }
예제 #5
0
 /// <summary>
 /// Inform the UI to show the share UI
 /// </summary>
 /// <param name="element"></param>
 private void Share(ShareableObject element)
 {
     MessengerInstance.Send(element);
 }
 /// <summary>
 /// Display the Share UI for the user to share the displayed conference
 /// </summary>
 /// <param name="conference">The conference converted in a generic object</param>
 private void Share(ShareableObject conference)
 {
     DataTransferManager.ShowShareUI();
 }
 /// <summary>
 /// Display the Share UI for the user to share the displayed show
 /// </summary>
 /// <param name="show">The show converted in a generic object</param>
 private void Share(ShareableObject show)
 {
     DataTransferManager.ShowShareUI();
 }
예제 #8
0
 /// <summary>
 /// Show the UI to share the conference on social networks
 /// </summary>
 /// <param name="conference">Conference transformed in adapted shareable object</param>
 private void Share(ShareableObject conference)
 {
     ShareTaskHelper.Share(conference);
 }
예제 #9
0
 /// <summary>
 /// Show the UI to share the meeting on social networks
 /// </summary>
 /// <param name="salon">Show transformed in adapted shareable object</param>
 private void Share(ShareableObject salon)
 {
     ShareTaskHelper.Share(salon);
 }
예제 #10
0
 /// <summary>
 /// Show the UI to share the news on social networks
 /// </summary>
 /// <param name="news">News transformed in adapted shareable object</param>
 private void Share(ShareableObject news)
 {
     ShareTaskHelper.Share(news);
 }