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


C# Windows.GetBasicPropertiesAsync方法代码示例

本文整理汇总了C#中Windows.GetBasicPropertiesAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Windows.GetBasicPropertiesAsync方法的具体用法?C# Windows.GetBasicPropertiesAsync怎么用?C# Windows.GetBasicPropertiesAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Windows的用法示例。


在下文中一共展示了Windows.GetBasicPropertiesAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UploadAsync

            public async Task UploadAsync(Windows.Storage.StorageFile sourceFile,
                string containerName, string blobName)
            {
                var properties = await sourceFile.GetBasicPropertiesAsync();
                if (properties.Size > (1024 * 1024 * 64))
                    throw new Exception("File cannot be larger than 64MB");

                var container = this.Parent.GetContainer(containerName);
                var blob = container.GetBlockBlobReference(blobName);
                await blob.UploadFromFileAsync(sourceFile);
            }
开发者ID:ruisebastiao,项目名称:Template10,代码行数:11,代码来源:AzureBlobHelper.cs

示例2: UploadBackgroundAsync

            public async Task<Windows.Networking.BackgroundTransfer.UploadOperation> UploadBackgroundAsync(Windows.Storage.StorageFile sourceFile,
                string containerName, string blobName, Action<Windows.Networking.BackgroundTransfer.UploadOperation> progressCallback = null)
            {
                var properties = await sourceFile.GetBasicPropertiesAsync();
                if (properties.Size > (1024 * 1024 * 64))
                    throw new Exception("File cannot be larger than 64MB");

                var permissions = Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions.Write;
                var container = this.Parent.GetContainer(containerName);
                var signature = this.GetSas(permissions, TimeSpan.FromMinutes(5), container.Name, blobName);
                var uploader = new Windows.Networking.BackgroundTransfer.BackgroundUploader
                {
                    TransferGroup = Windows.Networking.BackgroundTransfer.BackgroundTransferGroup.CreateGroup(_groupName)
                };
                uploader.SetRequestHeader("Filename", sourceFile.Name);
                var upload = uploader.CreateUpload(signature, sourceFile);
                if (progressCallback == null)
                    return await upload.StartAsync();
                else
                    return await upload.StartAsync().AsTask(new Progress<Windows.Networking.BackgroundTransfer.UploadOperation>(progressCallback));
            }
开发者ID:ruisebastiao,项目名称:Template10,代码行数:21,代码来源:AzureBlobHelper.cs

示例3: OpenPDFDocument

        //////////////////////////////////////////////////////////////// open pdf and load pdf and calculate pdf size and unload pdf      
        private async void OpenPDFDocument(Windows.Storage.StorageFile file)
        {
            if (file != null)
            {
                Windows.Storage.FileProperties.BasicProperties properties = await file.GetBasicPropertiesAsync();
                m_SDKDocument = new FSDK_Document();
                //Load PDF document
                int result = await m_SDKDocument.OpenDocumentAsync(file, (int)properties.Size);
                if(result != 0)
                {
                    return;
                }
                m_PDFDoc.pointer = m_SDKDocument.m_hDoc.pointer;
                m_iPageCount = m_PDFFunction.My_Doc_CountPages(m_PDFDoc);

                //import wordlist into struct
                string[] testStr = new string[WordNumber];
                testStr = Wordlist;
                wordInfo wInfo;
                for (int count = 0; count < testStr.Length; count++)
                {
                    bool[] testData = new bool[m_iPageCount];
                    for (int count1 = 0; count1 < testData.Length; count1++)
                    {
                        testData[count1] = false;
                    }
                    wInfo.word = testStr[count];
                    wInfo.annotFlag = testData;
                    wordInfoList.Add(wInfo);
                }

                //Load first two PDF page
                result = LoadPage(0);
                if(result != 0)
                {
                    return;
                }
                result = LoadPage(1);
                if (result != 0)
                {
                    return;
                }
                nextInvisibleIndex = 2;
                 
                //get page size and calculate suitable render size
                GetPageInfo();
                m_dbScaleFator = (m_dbCommonFitWidthScale < m_dbCommonFitHeightScale) ? m_dbCommonFitWidthScale : m_dbCommonFitHeightScale;
                CalcRenderSize();

                //Show PDF page to device.
                initPdfGrid(m_iPageCount);
                ShowPage();

                //initial preview page 
                preview_visiblePage = new Dictionary<int, PageHandle>();
                Preview_InitGrid();
            }
            return;

        }
开发者ID:JepsonLin,项目名称:ASEproject,代码行数:61,代码来源:renderPage.xaml.cs


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