Пример #1
0
        public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return(true);
            }

            COMCLSIDServerDotNetEntry right = obj as COMCLSIDServerDotNetEntry;

            if (right == null)
            {
                return(false);
            }

            return(AssemblyName.Equals(right.AssemblyName) && ClassName.Equals(right.ClassName) &&
                   CodeBase.Equals(right.CodeBase) && RuntimeVersion.Equals(right.RuntimeVersion));
        }
Пример #2
0
        internal COMCLSIDServerEntry(RegistryKey key, COMServerType server_type)
            : this(server_type)
        {
            string server_string = key.ReadString();
            RawServer = key.ReadString(options: RegistryValueOptions.DoNotExpandEnvironmentNames);

            if (string.IsNullOrWhiteSpace(server_string))
            {
                // TODO: Support weird .NET registration which registers a .NET version string.
                return;
            }

            bool process_command_line = false;
            CommandLine = string.Empty;

            if (server_type == COMServerType.LocalServer32)
            {
                string executable = key.ReadString(valueName: "ServerExecutable");
                if (!string.IsNullOrWhiteSpace(executable))
                {
                    server_string = executable;
                }
                else
                {
                    process_command_line = true;
                }
                CommandLine    = server_string;
                ThreadingModel = COMThreadingModel.Both;
            }
            else if (server_type == COMServerType.InProcServer32)
            {
                ThreadingModel = ReadThreadingModel(key);
                if (key.GetValue("Assembly") != null)
                {
                    DotNet = new COMCLSIDServerDotNetEntry(key);
                }
            }
            else
            {
                ThreadingModel = COMThreadingModel.Apartment;
            }

            Server = ProcessFileName(server_string, process_command_line);
        }