• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LiveConnectClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LiveConnectClient的典型用法代码示例。如果您正苦于以下问题:C# LiveConnectClient类的具体用法?C# LiveConnectClient怎么用?C# LiveConnectClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LiveConnectClient类属于命名空间,在下文中一共展示了LiveConnectClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: StreamCopyOperation

        public StreamCopyOperation(
            LiveConnectClient client, 
            ApiMethod method, 
            Stream inputStream, 
            Stream outputStream, 
            long contentLength, 
            object progress,
            SynchronizationContextWrapper syncContext, 
            Action<bool, Exception> onCopyCompleted)
            : base(syncContext)
        {
            Debug.Assert(client != null, "client must not be null.");
            Debug.Assert(
                method == ApiMethod.Download || method == ApiMethod.Upload,
                "Only Download and Upload methods are allowed.");
            Debug.Assert(inputStream.CanRead, "Input stream is not readable.");
            Debug.Assert(outputStream.CanWrite, "Output stream is not writable.");

            this.LiveClient = client;
            this.Method = method;
            this.InputStream = inputStream;
            this.OutputStream = outputStream;
            this.ContentLength = contentLength;
            this.buffer = new byte[StreamCopyOperation.BufferSize];
            this.copyCompletedCallback = onCopyCompleted;
            this.progress = progress;
        }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:27,代码来源:StreamCopyOperation.cs


示例2: btnUploadDirectory_Click

        private void btnUploadDirectory_Click(object sender, RoutedEventArgs e)
        {
            //Show folder picker...
            var dialog = new System.Windows.Forms.FolderBrowserDialog();
            dialog.ShowDialog();
            //END Show folder picker...

            //Get a recusive list of all files...
            if (dialog.SelectedPath == "")
            {
                System.Windows.MessageBox.Show("No folder selected.");
                return;
            }
            string[] files = Directory.GetFiles(dialog.SelectedPath, "*.*", SearchOption.AllDirectories);

            foreach (string file in files)
            {
                txtRaw.Text += file + "\r\n";
                LiveConnectClient client = new LiveConnectClient(Properties.session);

                client.UploadCompleted += this.ConnectClient_UploadCompleted;
                var stream = default(Stream);
                stream = File.OpenRead(file);
                client.UploadAsync(Properties.UltiDriveFolderID + "/files", file, stream, stream);
                stream.Close();
                //System.Windows.MessageBox.Show(file);
            }
            //END Get a recursive list of all files...
        }
开发者ID:shafe123,项目名称:UltiDrive,代码行数:29,代码来源:TestingWindow.xaml.cs


示例3: ForegroundUploadOperation

 public ForegroundUploadOperation(LiveConnectClient client, Uri url, string filename, IFileSource inputFile, OverwriteOption option, IProgress<LiveOperationProgress> progress, SynchronizationContextWrapper syncContext)
     : base(client, url, ApiMethod.Upload, null, syncContext)
 {
     this.Filename = filename;
     this.Progress = progress;
     this.OverwriteOption = option;
     this.FileSource = inputFile;
 }
开发者ID:rgregg,项目名称:PortableLiveConnectSDK,代码行数:8,代码来源:ForegroundUploadOperation.cs


示例4: CreateBackgroundDownloadOperation

 /// <summary>
 /// Creates a new TailoredDownloadOperation instance.
 /// </summary>
 public CreateBackgroundDownloadOperation(
     LiveConnectClient client, 
     Uri url, 
     IStorageFile outputFile)
     : base(client, url, ApiMethod.Download, null, null)
 {
     this.OutputFile = outputFile;
 }
开发者ID:d20021,项目名称:LiveSDK-for-Windows,代码行数:11,代码来源:CreateBackgroundDownloadOperation.cs


示例5: DownloadOperation

 public DownloadOperation(
     LiveConnectClient client, 
     Uri url, 
     object progress, 
     SynchronizationContextWrapper syncContext)
     : base(client, url, ApiMethod.Download, null, syncContext)
 {
     this.progress = progress;
 }
开发者ID:rgregg,项目名称:PortableLiveConnectSDK,代码行数:9,代码来源:DownloadOperation.cs


示例6: ApiWriteOperation

 public ApiWriteOperation(
     LiveConnectClient client, 
     Uri url, 
     ApiMethod method, 
     string body, 
     SynchronizationContextWrapper syncContext)
     : base(client, url, method, body, syncContext)
 {
 }
开发者ID:namy14,项目名称:LiveSDK-for-Windows,代码行数:9,代码来源:ApiWriteOperation.cs


示例7: GetUploadLinkOperation

 public GetUploadLinkOperation(
     LiveConnectClient client, 
     Uri url, 
     string fileName, 
     OverwriteOption option, 
     SynchronizationContextWrapper syncContext)
     : base(client, url, ApiMethod.Get, null, syncContext)
 {
     this.FileName = fileName;
     this.OverwriteOption = option;
 }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:11,代码来源:GetUploadLinkOperation.cs


示例8: TailoredDownloadOperation

 /// <summary>
 /// Creates a new TailoredDownloadOperation instance.
 /// </summary>
 public TailoredDownloadOperation(
     LiveConnectClient client, 
     Uri url, 
     IStorageFile outputFile, 
     IProgress<LiveOperationProgress> progress,
     SynchronizationContextWrapper syncContext)
     : base(client, url, ApiMethod.Download, null, syncContext)
 {
     this.OutputFile = outputFile;
     this.Progress = progress;
 }
开发者ID:d20021,项目名称:LiveSDK-for-Windows,代码行数:14,代码来源:TailoredDownloadOperation.cs


示例9: ApiOperation

 /// <summary>
 /// Constructs a new ApiOperation object.
 /// </summary>
 public ApiOperation(
     LiveConnectClient client, 
     Uri url, 
     ApiMethod method, 
     string body, 
     SynchronizationContextWrapper syncContext)
     : base(url, body, syncContext)
 {
     this.Method = method;
     this.LiveClient = client;
 }
开发者ID:xsIceman,项目名称:LiveSDK-for-Windows,代码行数:14,代码来源:ApiOperation.cs


示例10: TestExecute

        public void TestExecute()
        {
            WebRequestFactory.Current = new TestWebRequestFactory();
            LiveConnectClient connectClient = new LiveConnectClient(new LiveConnectSession());
            Uri requestUri = new Uri("http://foo.com");
            string fileName = string.Empty;
            OverwriteOption overwriteOption = OverwriteOption.Overwrite;
            SynchronizationContextWrapper syncContextWrapper = SynchronizationContextWrapper.Current;

            var apiOperation =
                new GetUploadLinkOperation(connectClient, requestUri, fileName, overwriteOption, syncContextWrapper);
        }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:12,代码来源:GetUploadLinkOperationTest.cs


示例11: TestExecute

        public void TestExecute()
        {
            WebRequestFactory.Current = new TestWebRequestFactory();
            LiveConnectClient connectClient = new LiveConnectClient(new LiveConnectSession());
            Uri requestUri = new Uri("http://foo.com");
            ApiMethod apiMethod = ApiMethod.Copy;
            string body = string.Empty;
            SynchronizationContextWrapper syncContextWrapper = SynchronizationContextWrapper.Current;

            var apiOperation =
                new ApiWriteOperation(connectClient, requestUri, apiMethod, body, syncContextWrapper);
        }
开发者ID:d20021,项目名称:LiveSDK-for-Windows,代码行数:12,代码来源:ApiWriteOperationTest.cs


示例12: checkSkyDriveInitiatedStart

 public static void checkSkyDriveInitiatedStart(object sender, RoutedEventArgs e)
 {
     //Check to see if user is logged in
     if (SkyDrive.Properties.LoggedIn)
     {
         //Check to see if SkyDrive is initiated for UltiDrive
         LiveConnectClient client = new LiveConnectClient(SkyDrive.Properties.session);
         client.GetCompleted += skydrive_checkInitiated;
         client.GetAsync("me/skydrive/files"); //Get list of files in root directory of SkyDrive.
         //END Check to see if SkyDrive is initiated for UltiDrive
     }
 }
开发者ID:shafe123,项目名称:UltiDrive,代码行数:12,代码来源:Utilities.cs


示例13: TestDeleteNullPath

 public void TestDeleteNullPath()
 {
     var connectClient = new LiveConnectClient(new LiveConnectSession());
     try
     {
         connectClient.DeleteAsync(null);
         Assert.Fail("Expected ArguementNullException to be thrown.");
     }
     catch (ArgumentNullException)
     {
     }
 }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:12,代码来源:LiveConnectClientTest.cs


示例14: TestGetWhiteSpaceStringPath

 public void TestGetWhiteSpaceStringPath()
 {
     var connectClient = new LiveConnectClient(new LiveConnectSession());
     try
     {
         connectClient.GetAsync("\t\n ");
         Assert.Fail("Expected ArguementException to be thrown.");
     }
     catch (ArgumentException)
     {
     }
 }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:12,代码来源:LiveConnectClientTest.cs


示例15: TestExecute

        public void TestExecute()
        {
            WebRequestFactory.Current = new TestWebRequestFactory();
            var connectClient = new LiveConnectClient(new LiveConnectSession());
            var requestUrl = new Uri("http://foo.com");
            IStorageFile outputFile = new StorageFileStub();
            IProgress<LiveOperationProgress> progress = new Progress<LiveOperationProgress>();
            SynchronizationContextWrapper syncContext = SynchronizationContextWrapper.Current;

            var tailoredDownloadOperation =
                new TailoredDownloadOperation(connectClient, requestUrl, outputFile, progress, syncContext);
        }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:12,代码来源:TailoredDownloadOperationTest.cs


示例16: TailoredUploadOperation

 /// <summary>
 /// This class implements the upload operation on Windows 8 using the background uploader.
 /// </summary>
 /// <remarks>This constructor is used when uploading a stream created by the application.</remarks>
 internal TailoredUploadOperation(
     LiveConnectClient client,
     Uri url,
     string fileName,
     OverwriteOption option,
     IProgress<LiveOperationProgress> progress,
     SynchronizationContextWrapper syncContext)
     : base(client, url, ApiMethod.Upload, null, syncContext)
 {
     this.FileName = fileName;
     this.Progress = progress;
     this.OverwriteOption = option;
 }
开发者ID:xsIceman,项目名称:LiveSDK-for-Windows,代码行数:17,代码来源:TailoredUploadOperation.cs


示例17: btnListAllFiles_Click

 private void btnListAllFiles_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         LiveConnectClient liveClient = new LiveConnectClient(Properties.session);
         liveClient.GetCompleted += this.ConnectClient_GetCompleted;
         liveClient.GetAsync("me/skydrive/files");
     }
     catch (LiveConnectException exception)
     {
         txtTestBox.Text = "Error getting folder info: " + exception.Message;
     }
 }
开发者ID:shafe123,项目名称:UltiDrive,代码行数:13,代码来源:TestingWindow.xaml.cs


示例18: TailoredUploadOperation

 /// <summary>
 /// This class implements the upload operation on Windows 8 using the background uploader.
 /// </summary>
 /// <remarks>This constructor is used when uploading a stream created by the application.</remarks>
 public TailoredUploadOperation(
     LiveConnectClient client,
     Uri url,
     string fileName,
     IInputStream inputStream,
     OverwriteOption option,
     IProgress<LiveOperationProgress> progress,
     SynchronizationContextWrapper syncContext)
     : this(client, url, fileName, option, progress, syncContext)
 {
     Debug.Assert(inputStream != null, "inputStream is null.");
     this.InputStream = inputStream;
 }
开发者ID:kam193,项目名称:LiveSDK-for-Windows,代码行数:17,代码来源:TailoredUploadOperation.cs


示例19: CreateBackgroundUploadOperation

        /// <summary>
        /// This class implements the upload operation on Windows 8 using the background uploader.
        /// </summary>
        /// <remarks>This constructor is used when uploading a stream created by the application.</remarks>
        public CreateBackgroundUploadOperation(
            LiveConnectClient client,
            Uri url,
            string fileName,
            IInputStream inputStream,
            OverwriteOption option)
            : base(client, url, ApiMethod.Upload, null, null)
        {
            Debug.Assert(inputStream != null, "inputStream is null.");

            this.InputStream = inputStream;
            this.FileName = fileName;
            this.OverwriteOption = option;
        }
开发者ID:harishdotnarayanan,项目名称:LiveSDK-for-Windows,代码行数:18,代码来源:CreateBackgroundUploadOperation.cs


示例20: DeleteFile

        public static bool DeleteFile(string guid)
        {
            validateSession();
            try
            {
                guidToDeleteQueue.Enqueue(guid);
                LiveConnectClient client = new LiveConnectClient(Properties.session);
                client.GetCompleted += DeleteFileHelper;
                client.GetAsync(SkyDrive.Properties.UltiDriveFolderID + "/files");

                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                return false;
            }
        }
开发者ID:shafe123,项目名称:UltiDrive,代码行数:18,代码来源:SkyDriveApi.cs



注:本文中的LiveConnectClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TutorParser.HardCodedParserMain类代码示例发布时间:2022-05-24
下一篇:
C# LittleEndianOutput类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap