当前位置: 首页>>代码示例>>C#>>正文


C# LiveConnectClient类代码示例

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


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


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