Beispiel #1
0
        public AssemblyName(string assemblyName)
            : this()
        {
            if (assemblyName == null)
            {
                throw new ArgumentNullException(nameof(assemblyName));
            }
            if ((assemblyName.Length == 0) ||
                (assemblyName[0] == '\0'))
            {
                throw new ArgumentException(SR.Format_StringZeroLength);
            }

            AssemblyNameParser.AssemblyNameParts parts = AssemblyNameParser.Parse(assemblyName);
            _name    = parts._name;
            _version = parts._version;
            _flags   = parts._flags;
            if ((parts._flags & AssemblyNameFlags.PublicKey) != 0)
            {
                _publicKey = parts._publicKeyOrToken;
            }
            else
            {
                _publicKeyToken = parts._publicKeyOrToken;
            }

            if (parts._cultureName != null)
            {
                _cultureInfo = new CultureInfo(parts._cultureName);
            }
        }
Beispiel #2
0
        public AssemblyName(string assemblyName)
        {
            if (assemblyName == null)
            {
                throw new ArgumentNullException(nameof(assemblyName));
            }
            RuntimeAssemblyName runtimeAssemblyName = AssemblyNameParser.Parse(assemblyName);

            runtimeAssemblyName.CopyToAssemblyName(this);
        }
Beispiel #3
0
        public AssemblyName(string assemblyName)
            : this()
        {
            if (assemblyName == null)
                throw new ArgumentNullException(nameof(assemblyName));
            if ((assemblyName.Length == 0) ||
                (assemblyName[0] == '\0'))
                throw new ArgumentException(SR.Format_StringZeroLength);

            _name = assemblyName;
            RuntimeAssemblyName runtimeAssemblyName = AssemblyNameParser.Parse(_name);
            runtimeAssemblyName.CopyToAssemblyName(this);
        }
 public static RuntimeAssemblyName Parse(string name)
 {
     AssemblyNameParser.AssemblyNameParts parts = AssemblyNameParser.Parse(name);
     return(new RuntimeAssemblyName(parts._name, parts._version, parts._cultureName, parts._flags, parts._publicKeyOrToken));
 }