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


C# BlobHandle类代码示例

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


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

示例1: SaveVhdAndAssertContent

        protected void SaveVhdAndAssertContent(BlobHandle destination, FileInfo localFile, int? numThread, string storageKey, bool overwrite, bool deleteBlob, bool deleteLocal)
        {
            try
            {
                Console.WriteLine("Downloading a VHD from {0} to {1}...", destination.Blob.Uri.ToString(), localFile.FullName);
                DateTime startTime = DateTime.Now;
                VhdDownloadContext result = vmPowershellCmdlets.SaveAzureVhd(destination.Blob.Uri, localFile, numThread, storageKey, overwrite);
                Console.WriteLine("Downloading completed in {0} seconds.", (DateTime.Now - startTime).TotalSeconds);

                string calculateMd5Hash = CalculateContentMd5(File.OpenRead(result.LocalFilePath.FullName));

                Assert.IsTrue(VerifyMD5hash(destination, calculateMd5Hash));

                if (deleteBlob)
                {
                    destination.Blob.Delete();
                }

                if (deleteLocalFileIfPassed && deleteLocal)
                {
                    File.Delete(localFile.FullName);
                }
            }
            catch (Exception e)
            {
                if (deleteLocalFileIfFailed && deleteLocal)
                {
                    File.Delete(localFile.FullName);
                }
                Assert.Fail(e.InnerException.ToString());
            }
        }
开发者ID:redwater,项目名称:azure-sdk-tools,代码行数:32,代码来源:AzureVhdTest.cs

示例2: Initialize

        public void Initialize()
        {
            pass = true;
            testStartTime = DateTime.Now;
            storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(defaultAzureSubscription.CurrentStorageAccountName);  

            // Set the source blob
            blobHandle = Utilities.GetBlobHandle(vhdBlobLocation, storageAccountKey.Primary);            
        }
开发者ID:kangyangthu,项目名称:azure-sdk-tools,代码行数:9,代码来源:SaveAzureVhdTest.cs

示例3: FormatAssemblyInfo

        private static AssemblyReferenceInformation FormatAssemblyInfo(this MetadataReader metadataReader, string name, StringHandle cultureHandle, BlobHandle publicKeyTokenHandle, Version version)
        {
            var culture = cultureHandle.IsNil
                ? "neutral"
                : metadataReader.GetString(cultureHandle);

            var publicKeyToken = publicKeyTokenHandle.IsNil
                ? "null"
                : metadataReader.FormatPublicKeyToken(publicKeyTokenHandle);

            return new AssemblyReferenceInformation(name, version, culture, publicKeyToken);
        }
开发者ID:AlexGhiondea,项目名称:dotnet-apiport,代码行数:12,代码来源:MetadataReaderExtensions.cs

示例4: SaveVhd

 protected static void SaveVhd(BlobHandle destination, FileInfo locFile, string storageKey, int? numThread = null, bool overwrite = false)
 {
     try
     {
         Console.WriteLine("Downloading a VHD from {0} to {1}...", destination.Blob.Uri.ToString(), locFile.FullName);
         DateTime startTime = DateTime.Now;
         vmPowershellCmdlets.SaveAzureVhd(destination.Blob.Uri, locFile, numThread, storageKey, overwrite);
         Console.WriteLine("Downloading completed in {0} seconds.", (DateTime.Now - startTime).TotalSeconds);
     }
     catch (Exception e)
     {
         Assert.Fail(e.InnerException.ToString());
     }
 }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:14,代码来源:AzureVhdTest.cs

示例5: ImportDefinition

        internal ImportDefinition(
            ImportDefinitionKind kind,
            BlobHandle alias = default(BlobHandle),
            AssemblyReferenceHandle assembly = default(AssemblyReferenceHandle),
            Handle typeOrNamespace = default(Handle))
        {
            Debug.Assert(
                typeOrNamespace.IsNil ||
                typeOrNamespace.Kind == HandleKind.Blob ||
                typeOrNamespace.Kind == HandleKind.TypeDefinition ||
                typeOrNamespace.Kind == HandleKind.TypeReference ||
                typeOrNamespace.Kind == HandleKind.TypeSpecification);

            _kind = kind;
            _alias = alias;
            _assembly = assembly;
            _typeOrNamespace = typeOrNamespace;
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:18,代码来源:ImportDefinition.cs

示例6: CreateRuntimeAssemblyNameFromMetadata

        private static RuntimeAssemblyName CreateRuntimeAssemblyNameFromMetadata(
            MetadataReader reader,
            StringHandle name,
            Version version,
            StringHandle culture,
            BlobHandle publicKeyOrToken,
            AssemblyFlags assemblyFlags)
        {
            AssemblyNameFlags assemblyNameFlags = AssemblyNameFlags.None;
            if (0 != (assemblyFlags & AssemblyFlags.PublicKey))
                assemblyNameFlags |= AssemblyNameFlags.PublicKey;
            if (0 != (assemblyFlags & AssemblyFlags.Retargetable))
                assemblyNameFlags |= AssemblyNameFlags.Retargetable;
            int contentType = ((int)assemblyFlags) & 0x00000E00;
            assemblyNameFlags |= (AssemblyNameFlags)contentType;

            return new RuntimeAssemblyName(
                name.GetString(reader),
                version,
                culture.GetString(reader),
                assemblyNameFlags,
                reader.GetBlobContent(publicKeyOrToken).ToArray()
                );
        }
开发者ID:nattress,项目名称:corert,代码行数:24,代码来源:MetadataReaderExtensions.Ecma.cs

示例7: AddCustomDebugInformation

 public void AddCustomDebugInformation(EntityHandle parent, GuidHandle kind, BlobHandle value)
 {
     _customDebugInformationTable.Add(new CustomDebugInformationRow
     {
         Parent = (uint)CodedIndex.ToHasCustomDebugInformation(parent),
         Kind = kind,
         Value = value
     });
 }
开发者ID:tzetang,项目名称:corefx,代码行数:9,代码来源:MetadataBuilder.Tables.cs

示例8: AddLocalConstant

        public LocalConstantHandle AddLocalConstant(StringHandle name, BlobHandle signature)
        {
            _localConstantTable.Add(new LocalConstantRow
            {
                Name = name,
                Signature = signature
            });

            return MetadataTokens.LocalConstantHandle(_localConstantTable.Count);
        }
开发者ID:tzetang,项目名称:corefx,代码行数:10,代码来源:MetadataBuilder.Tables.cs

示例9: AddDocument

        public DocumentHandle AddDocument(BlobHandle name, GuidHandle hashAlgorithm, BlobHandle hash, GuidHandle language)
        {
            _documentTable.Add(new DocumentRow
            {
                Name = name,
                HashAlgorithm = hashAlgorithm,
                Hash = hash,
                Language = language
            });

            return MetadataTokens.DocumentHandle(_documentTable.Count);
        }
开发者ID:tzetang,项目名称:corefx,代码行数:12,代码来源:MetadataBuilder.Tables.cs

示例10: AddAssemblyFile

 public void AddAssemblyFile(
     StringHandle name,
     BlobHandle hashValue,
     bool containsMetadata)
 {
     _fileTable.Add(new FileTableRow
     {
         FileName = name,
         Flags = containsMetadata ? 0u : 1u,
         HashValue = hashValue
     });
 }
开发者ID:tzetang,项目名称:corefx,代码行数:12,代码来源:MetadataBuilder.Tables.cs

示例11: AddMethodDefinition

        public MethodDefinitionHandle AddMethodDefinition(
            MethodAttributes attributes, 
            MethodImplAttributes implAttributes,
            StringHandle name,
            BlobHandle signature,
            int bodyOffset,
            ParameterHandle paramList)
        {
            _methodDefTable.Add(new MethodRow
            {
                Flags = (ushort)attributes,
                ImplFlags = (ushort)implAttributes,
                Name = name,
                Signature = signature,
                BodyOffset = bodyOffset,
                ParamList = (uint)MetadataTokens.GetRowNumber(paramList)
            });

            return MetadataTokens.MethodDefinitionHandle(_methodDefTable.Count);
        }
开发者ID:tzetang,项目名称:corefx,代码行数:20,代码来源:MetadataBuilder.Tables.cs

示例12: GetBlobReader

 public BlobReader GetBlobReader(BlobHandle handle)
 {
     return BlobHeap.GetBlobReader(handle);
 }
开发者ID:SamuelEnglard,项目名称:corefx,代码行数:4,代码来源:MetadataReader.cs

示例13: GetBlobBytes

 public byte[] GetBlobBytes(BlobHandle handle)
 {
     return BlobHeap.GetBytes(handle);
 }
开发者ID:SamuelEnglard,项目名称:corefx,代码行数:4,代码来源:MetadataReader.cs

示例14: AssertContentMD5

        private void AssertContentMD5(string destination, bool deleteBlob)
        {
            string downloadedFile = DownloadToFile(destination);

            var calculateMd5Hash = CalculateContentMd5(File.OpenRead(downloadedFile));

            BlobUri blobUri2;
            Assert.IsTrue(BlobUri.TryParseUri(new Uri(destination), out blobUri2));
            var blobHandle = new BlobHandle(blobUri2, storageAccountKey.Primary);

            Assert.AreEqual(calculateMd5Hash, blobHandle.Blob.Properties.ContentMD5);

            if (deleteBlob)
            {
                blobHandle.Blob.Delete();
            }
        }
开发者ID:bielawb,项目名称:azure-sdk-tools,代码行数:17,代码来源:AddAzureVhdTest.cs

示例15: AddFieldDefinition

 public void AddFieldDefinition(
     FieldAttributes attributes,
     StringHandle name,
     BlobHandle signature)
 {
     _fieldTable.Add(new FieldDefRow
     {
         Flags = (ushort)attributes,
         Name = name,
         Signature = signature
     });
 }
开发者ID:tzetang,项目名称:corefx,代码行数:12,代码来源:MetadataBuilder.Tables.cs


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