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

C# AssemblyNameFlags类代码示例

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

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



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

示例1: CreateAssemblyName

        private static AssemblyName CreateAssemblyName(MetadataName name, MetadataName culture, Version version, AssemblyNameFlags flags, byte[] publicKeyOrToken) {
            var result = new AssemblyName();

            result.Name = name.ToString();
            if (!culture.IsEmpty) {
                result.CultureInfo = new CultureInfo(culture.ToString());
            }

            result.Version = version;
            result.Flags = flags;

            if (publicKeyOrToken.Length != 0) {
                if ((result.Flags & AssemblyNameFlags.PublicKey) != 0) {
                    result.SetPublicKey(publicKeyOrToken);
                } else {
                    result.SetPublicKeyToken(publicKeyOrToken);
                }
            }

            return result;
        }
开发者ID:madpilot,项目名称:ironruby,代码行数:21,代码来源:MetadataExtensions.cs


示例2: AssemblyFlagsAttribute

 public AssemblyFlagsAttribute(uint flags)
 {
     m_flags = (AssemblyNameFlags)flags;
 }
开发者ID:l1183479157,项目名称:coreclr,代码行数:4,代码来源:AssemblyAttributes.cs


示例3: AssemblyName

 public AssemblyName()
 { 
     _HashAlgorithm = AssemblyHashAlgorithm.None;
     _VersionCompatibility = AssemblyVersionCompatibility.SameMachine;
     _Flags = AssemblyNameFlags.None;
 }
开发者ID:AtsushiKan,项目名称:coreclr,代码行数:6,代码来源:AssemblyName.cs


示例4: AssemblyName

 public AssemblyName()
 {
     _Flags = AssemblyNameFlags.None;
 }
开发者ID:huamichaelchen,项目名称:corert,代码行数:4,代码来源:AssemblyName.cs


示例5: AssemblyName

		public AssemblyName(string assemblyName)
		{
			if (assemblyName == null)
			{
				throw new ArgumentNullException("assemblyName");
			}
			if (assemblyName == "")
			{
				throw new ArgumentException();
			}
			ParsedAssemblyName parsed;
			switch (Fusion.ParseAssemblyName(assemblyName, out parsed))
			{
				case ParseAssemblyResult.GenericError:
				case ParseAssemblyResult.DuplicateKey:
					throw new FileLoadException();
			}
			if (!ParseVersion(parsed.Version, parsed.Retargetable.HasValue, out version))
			{
				throw new FileLoadException();
			}
			name = parsed.Name;
			if (parsed.Culture != null)
			{
				if (parsed.Culture.Equals("neutral", StringComparison.OrdinalIgnoreCase))
				{
					culture = "";
				}
				else if (parsed.Culture == "")
				{
					throw new FileLoadException();
				}
				else
				{
					culture = new CultureInfo(parsed.Culture).Name;
				}
			}
			if (parsed.PublicKeyToken != null)
			{
				if (parsed.PublicKeyToken.Equals("null", StringComparison.OrdinalIgnoreCase))
				{
					publicKeyToken = Empty<byte>.Array;
				}
				else if (parsed.PublicKeyToken.Length != 16)
				{
					throw new FileLoadException();
				}
				else
				{
					publicKeyToken = ParseKey(parsed.PublicKeyToken);
				}
			}
			if (parsed.Retargetable.HasValue)
			{
				if (parsed.Culture == null || parsed.PublicKeyToken == null || version == null)
				{
					throw new FileLoadException();
				}
				if (parsed.Retargetable.Value)
				{
					flags |= AssemblyNameFlags.Retargetable;
				}
			}
			ProcessorArchitecture = parsed.ProcessorArchitecture;
			if (parsed.WindowsRuntime)
			{
				ContentType = AssemblyContentType.WindowsRuntime;
			}
		}
开发者ID:Semogj,项目名称:ikvm-fork,代码行数:69,代码来源:AssemblyName.cs


示例6: GetAssemblyNameFromTypelib

 internal static AssemblyName GetAssemblyNameFromTypelib(object typeLib, string asmFileName, byte[] publicKey, StrongNameKeyPair keyPair, Version asmVersion, AssemblyNameFlags asmNameFlags)
 {
     string strName = null;
     string strDocString = null;
     int dwHelpContext = 0;
     string strHelpFile = null;
     ITypeLib typeLibrary = (ITypeLib) typeLib;
     typeLibrary.GetDocumentation(-1, out strName, out strDocString, out dwHelpContext, out strHelpFile);
     if (asmFileName == null)
     {
         asmFileName = strName;
     }
     else
     {
         string fileName = Path.GetFileName(asmFileName);
         string extension = Path.GetExtension(asmFileName);
         if (!".dll".Equals(extension, StringComparison.OrdinalIgnoreCase))
         {
             throw new ArgumentException(Environment.GetResourceString("Arg_InvalidFileExtension"));
         }
         asmFileName = fileName.Substring(0, fileName.Length - ".dll".Length);
     }
     if (asmVersion == null)
     {
         int num2;
         int num3;
         Marshal.GetTypeLibVersion(typeLibrary, out num2, out num3);
         asmVersion = new Version(num2, num3, 0, 0);
     }
     AssemblyName name = new AssemblyName();
     name.Init(asmFileName, publicKey, null, asmVersion, null, AssemblyHashAlgorithm.None, AssemblyVersionCompatibility.SameMachine, null, asmNameFlags, keyPair);
     return name;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:33,代码来源:TypeLibConverter.cs


示例7: ExtractAssemblyNameFlags

 internal static AssemblyNameFlags ExtractAssemblyNameFlags(AssemblyNameFlags combinedFlags)
 {
     return combinedFlags & unchecked((AssemblyNameFlags)0xFFFFF10F);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:4,代码来源:AssemblyNameHelpers.cs


示例8: CombineAssemblyNameFlags

 internal static AssemblyNameFlags CombineAssemblyNameFlags(AssemblyNameFlags flags, AssemblyContentType contentType, ProcessorArchitecture processorArchitecture)
 {
     return (AssemblyNameFlags)(((int)flags) | (((int)contentType) << 9) | ((int)processorArchitecture << 4));
 }
开发者ID:tijoytom,项目名称:corert,代码行数:4,代码来源:AssemblyNameHelpers.cs


示例9: ExtractAssemblyContentType

 //
 // These helpers convert between the combined flags+contentType+processorArchitecture value and the separated parts.
 //
 // Since these are only for trusted callers, they do NOT check for out of bound bits.
 //
 internal static AssemblyContentType ExtractAssemblyContentType(AssemblyNameFlags flags)
 {
     return (AssemblyContentType)((((int)flags) >> 9) & 0x7);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:9,代码来源:AssemblyNameHelpers.cs


示例10: ExtractProcessorArchitecture

 internal static ProcessorArchitecture ExtractProcessorArchitecture(AssemblyNameFlags flags)
 {
     return (ProcessorArchitecture)((((int)flags) >> 4) & 0x7);
 }
开发者ID:tijoytom,项目名称:corert,代码行数:4,代码来源:AssemblyNameHelpers.cs


示例11: GetAssemblyNameFromTypelib

        [System.Security.SecurityCritical]  // auto-generated
        internal static AssemblyName GetAssemblyNameFromTypelib(Object typeLib, String asmFileName, byte[] publicKey, StrongNameKeyPair keyPair, Version asmVersion, AssemblyNameFlags asmNameFlags)
        {
            // Extract the name of the typelib.
            String strTypeLibName = null;
            String strDocString = null;
            int dwHelpContext = 0;
            String strHelpFile = null;
            ITypeLib pTLB = (ITypeLib)typeLib;
            pTLB.GetDocumentation(-1, out strTypeLibName, out strDocString, out dwHelpContext, out strHelpFile);

            // Retrieve the name to use for the assembly.
            if (asmFileName == null)
            {
                asmFileName = strTypeLibName;
            }
            else
            {
                Contract.Assert((asmFileName != null) && (asmFileName.Length > 0), "The assembly file name cannot be an empty string!");

                String strFileNameNoPath = Path.GetFileName(asmFileName);
                String strExtension = Path.GetExtension(asmFileName);

                // Validate that the extension is valid.
                bool bExtensionValid = ".dll".Equals(strExtension, StringComparison.OrdinalIgnoreCase);

                // If the extension is not valid then tell the user and quit.
                if (!bExtensionValid)
                    throw new ArgumentException(Environment.GetResourceString("Arg_InvalidFileExtension"));

                // The assembly cannot contain the path nor the extension.
                asmFileName = strFileNameNoPath.Substring(0, strFileNameNoPath.Length - ".dll".Length);
            }

            // If the version information was not specified, then retrieve it from the typelib.
            if (asmVersion == null)
            {
                int major;
                int minor;
                Marshal.GetTypeLibVersion(pTLB, out major, out minor);
                asmVersion = new Version(major, minor, 0, 0);
            }
            
            // Create the assembly name for the imported typelib's assembly.
            AssemblyName AsmName = new AssemblyName();
            AsmName.Init(
                asmFileName,
                publicKey,
                null,
                asmVersion,
                null,
                AssemblyHashAlgorithm.None,
                AssemblyVersionCompatibility.SameMachine,
                null,
                asmNameFlags,
                keyPair);

            return AsmName;
        }
开发者ID:Rayislandstyle,项目名称:dotnet-coreclr,代码行数:59,代码来源:TypeLibConverter.cs


示例12: AssemblyName

		internal AssemblyName (SerializationInfo si, StreamingContext sc)
		{
			name = si.GetString ("_Name");
			codebase = si.GetString ("_CodeBase");
			version = (Version)si.GetValue ("_Version", typeof (Version));
			publicKey = (byte[])si.GetValue ("_PublicKey", typeof (byte[]));
			keyToken = (byte[])si.GetValue ("_PublicKeyToken", typeof (byte[]));
			hashalg = (AssemblyHashAlgorithm)si.GetValue ("_HashAlgorithm", typeof (AssemblyHashAlgorithm));
			keypair = (StrongNameKeyPair)si.GetValue ("_StrongNameKeyPair", typeof (StrongNameKeyPair));
			versioncompat = (AssemblyVersionCompatibility)si.GetValue ("_VersionCompatibility", typeof (AssemblyVersionCompatibility));
			flags = (AssemblyNameFlags)si.GetValue ("_Flags", typeof (AssemblyNameFlags));
			int lcid = si.GetInt32 ("_CultureInfo");
			if (lcid != -1) cultureinfo = new CultureInfo (lcid);
		}
开发者ID:stabbylambda,项目名称:mono,代码行数:14,代码来源:AssemblyName.cs


示例13: AssemblyFlagsAttribute

		public AssemblyFlagsAttribute (AssemblyNameFlags assemblyFlags)
		{
			this.flags = (uint)assemblyFlags;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:4,代码来源:AssemblyFlagsAttribute.cs


示例14: __SetAssemblyFlags

		public void __SetAssemblyFlags(AssemblyNameFlags flags)
		{
			this.__AssemblyFlags = flags;
		}
开发者ID:Semogj,项目名称:ikvm-fork,代码行数:4,代码来源:AssemblyBuilder.cs


示例15: SetPublicKey

        public void SetPublicKey(byte[] publicKey)
        {
            _PublicKey = publicKey;

            if (publicKey == null)
                _Flags &= ~AssemblyNameFlags.PublicKey;
            else
                _Flags |= AssemblyNameFlags.PublicKey;
        }
开发者ID:AtsushiKan,项目名称:coreclr,代码行数:9,代码来源:AssemblyName.cs


示例16: SetPublicKey

		public void SetPublicKey(byte[] publicKey)
		{
			this.publicKey = publicKey;
			flags = (flags & ~AssemblyNameFlags.PublicKey) | (publicKey == null ? 0 : AssemblyNameFlags.PublicKey);
		}
开发者ID:Semogj,项目名称:ikvm-fork,代码行数:5,代码来源:AssemblyName.cs


示例17: CalculateProcArchIndex

        internal static ProcessorArchitecture CalculateProcArchIndex(PortableExecutableKinds pek, ImageFileMachine ifm, AssemblyNameFlags flags)
        {
            if (((uint)flags & 0xF0) == 0x70)
                return ProcessorArchitecture.None;

            if ((pek & System.Reflection.PortableExecutableKinds.PE32Plus) == System.Reflection.PortableExecutableKinds.PE32Plus)
            {
                switch (ifm)
                {
                    case System.Reflection.ImageFileMachine.IA64:
                        return ProcessorArchitecture.IA64;
                    case System.Reflection.ImageFileMachine.AMD64:
                        return ProcessorArchitecture.Amd64;
                    case System.Reflection.ImageFileMachine.I386:
                        if ((pek & System.Reflection.PortableExecutableKinds.ILOnly) == System.Reflection.PortableExecutableKinds.ILOnly)
                            return ProcessorArchitecture.MSIL;
                        break;
                }
            }
            else
            {
                if (ifm == System.Reflection.ImageFileMachine.I386)
                {
                    if ((pek & System.Reflection.PortableExecutableKinds.Required32Bit) == System.Reflection.PortableExecutableKinds.Required32Bit)
                        return ProcessorArchitecture.X86;

                    if ((pek & System.Reflection.PortableExecutableKinds.ILOnly) == System.Reflection.PortableExecutableKinds.ILOnly)
                        return ProcessorArchitecture.MSIL;

                    return ProcessorArchitecture.X86;
                }
                if (ifm == System.Reflection.ImageFileMachine.ARM)
                {
                    return ProcessorArchitecture.Arm;
                }
            }
            return ProcessorArchitecture.None;
        }
开发者ID:AtsushiKan,项目名称:coreclr,代码行数:38,代码来源:AssemblyName.cs


示例18: SetPublicKey

	// Set the public key for the assembly's originator.
	public void SetPublicKey(byte[] publicKey)
			{
				this.publicKey = publicKey;
				this.flags |= AssemblyNameFlags.PublicKey;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:6,代码来源:AssemblyName.cs


示例19: SetPublicKey

		public void SetPublicKey (byte[] publicKey) 
		{
			if (publicKey == null)
				flags ^= AssemblyNameFlags.PublicKey;
			else
				flags |= AssemblyNameFlags.PublicKey;
			this.publicKey = publicKey;
		}
开发者ID:stabbylambda,项目名称:mono,代码行数:8,代码来源:AssemblyName.cs


示例20: OnDeserialization

        public void OnDeserialization(Object sender)
        {
            // Deserialization has already been performed
            if (m_siInfo == null)
                return;

            _Name = m_siInfo.GetString("_Name");
            _PublicKey = (byte[]) m_siInfo.GetValue("_PublicKey", typeof(byte[]));
            _PublicKeyToken = (byte[]) m_siInfo.GetValue("_PublicKeyToken", typeof(byte[]));
#if FEATURE_USE_LCID
            int lcid = (int)m_siInfo.GetInt32("_CultureInfo");
            if (lcid != -1)
                _CultureInfo = new CultureInfo(lcid);
#endif

            _CodeBase = m_siInfo.GetString("_CodeBase");
            _Version = (Version) m_siInfo.GetValue("_Version", typeof(Version));
            _HashAlgorithm = (AssemblyHashAlgorithm) m_siInfo.GetValue("_HashAlgorithm", typeof(AssemblyHashAlgorithm));
            _StrongNameKeyPair = (StrongNameKeyPair) m_siInfo.GetValue("_StrongNameKeyPair", typeof(StrongNameKeyPair));
            _VersionCompatibility = (AssemblyVersionCompatibility)m_siInfo.GetValue("_VersionCompatibility", typeof(AssemblyVersionCompatibility));
            _Flags = (AssemblyNameFlags) m_siInfo.GetValue("_Flags", typeof(AssemblyNameFlags));

            try {
                _HashAlgorithmForControl = (AssemblyHashAlgorithm) m_siInfo.GetValue("_HashAlgorithmForControl", typeof(AssemblyHashAlgorithm));
                _HashForControl = (byte[]) m_siInfo.GetValue("_HashForControl", typeof(byte[]));    
            }
            catch (SerializationException) { // RTM did not have these defined
                _HashAlgorithmForControl = AssemblyHashAlgorithm.None;
                _HashForControl = null;
            }

            m_siInfo = null;
        }
开发者ID:AtsushiKan,项目名称:coreclr,代码行数:33,代码来源:AssemblyName.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# AssemblyNode类代码示例发布时间:2022-05-24
下一篇:
C# AssemblyName类代码示例发布时间: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