Beispiel #1
0
 internal void LoadIndirectResources(RegistryStringResourceIndirect resourceReader)
 {
     if (this.IsDefault)
     {
         this._description = resourceReader.GetResourceStringIndirect(this._assemblyName, this._moduleName, this._descriptionIndirect);
         this._vendor      = resourceReader.GetResourceStringIndirect(this._assemblyName, this._moduleName, this._vendorIndirect);
     }
     else
     {
         RegistryKey mshSnapinKey = this.MshSnapinKey;
         if (mshSnapinKey != null)
         {
             this._description = resourceReader.GetResourceStringIndirect(mshSnapinKey, "DescriptionIndirect", this._assemblyName, this._moduleName);
             this._vendor      = resourceReader.GetResourceStringIndirect(mshSnapinKey, "VendorIndirect", this._assemblyName, this._moduleName);
         }
     }
     if (string.IsNullOrEmpty(this._description))
     {
         this._description = this._descriptionFallback;
     }
     if (string.IsNullOrEmpty(this._vendor))
     {
         this._vendor = this._vendorFallback;
     }
 }
Beispiel #2
0
 internal void LoadIndirectResources()
 {
     using (RegistryStringResourceIndirect indirect = RegistryStringResourceIndirect.GetResourceIndirectReader())
     {
         this.LoadIndirectResources(indirect);
     }
 }
Beispiel #3
0
 protected override void EndProcessing()
 {
     if (this.resourceReader != null)
     {
         this.resourceReader.Dispose();
         this.resourceReader = null;
     }
 }
Beispiel #4
0
 public void Dispose()
 {
     if (!this._disposed)
     {
         if (this.resourceReader != null)
         {
             this.resourceReader.Dispose();
             this.resourceReader = null;
         }
         GC.SuppressFinalize(this);
     }
     this._disposed = true;
 }
Beispiel #5
0
 internal string GetResourceStringIndirect(
     RegistryKey key,
     string valueName,
     string assemblyName,
     string modulePath)
 {
     using (RegistryStringResourceIndirect.tracer.TraceMethod(valueName, new object[0]))
     {
         if (this._disposed)
         {
             throw RegistryStringResourceIndirect.tracer.NewInvalidOperationException("PSSnapinInfo", "ResourceReaderDisposed");
         }
         if (key == null)
         {
             throw RegistryStringResourceIndirect.tracer.NewArgumentNullException(nameof(key));
         }
         if (string.IsNullOrEmpty(valueName))
         {
             throw RegistryStringResourceIndirect.tracer.NewArgumentException(nameof(valueName));
         }
         if (string.IsNullOrEmpty(assemblyName))
         {
             throw RegistryStringResourceIndirect.tracer.NewArgumentException(nameof(assemblyName));
         }
         if (string.IsNullOrEmpty(modulePath))
         {
             throw RegistryStringResourceIndirect.tracer.NewArgumentException(nameof(modulePath));
         }
         string format           = (string)null;
         string keyValueAsString = RegistryStringResourceIndirect.GetRegKeyValueAsString(key, valueName);
         if (keyValueAsString != null)
         {
             format = this.GetResourceStringIndirect(assemblyName, modulePath, keyValueAsString);
         }
         RegistryStringResourceIndirect.tracer.WriteLine(format, new object[0]);
         return(format);
     }
 }
Beispiel #6
0
        internal void LoadIndirectResources(RegistryStringResourceIndirect resourceReader)
        {
            if (IsDefault)
            {
                // For default mshsnapins..resource indirects are hardcoded..
                // so dont read from the registry
                _description = resourceReader.GetResourceStringIndirect(
                    AssemblyName,
                    ModuleName,
                    _descriptionIndirect);

                _vendor = resourceReader.GetResourceStringIndirect(
                    AssemblyName,
                    ModuleName,
                    _vendorIndirect);
            }
            else
            {
                RegistryKey mshsnapinKey = MshSnapinKey;
                if (mshsnapinKey != null)
                {
                    _description =
                        resourceReader.GetResourceStringIndirect(
                            mshsnapinKey,
                            RegistryStrings.MshSnapin_DescriptionResource,
                            AssemblyName,
                            ModuleName);

                    _vendor =
                        resourceReader.GetResourceStringIndirect(
                            mshsnapinKey,
                            RegistryStrings.MshSnapin_VendorResource,
                            AssemblyName,
                            ModuleName);
                }
            }

            if (String.IsNullOrEmpty(_description))
            {
                _description = _descriptionFallback;
            }

            if (String.IsNullOrEmpty(_vendor))
            {
                _vendor = _vendorFallback;
            }
        }
Beispiel #7
0
 internal void LoadIndirectResources(RegistryStringResourceIndirect resourceReader)
 {
     if (this.IsDefault)
     {
         this._description = resourceReader.GetResourceStringIndirect(this._assemblyName, this._moduleName, this._descriptionIndirect);
         this._vendor = resourceReader.GetResourceStringIndirect(this._assemblyName, this._moduleName, this._vendorIndirect);
     }
     else
     {
         RegistryKey mshSnapinKey = this.MshSnapinKey;
         if (mshSnapinKey != null)
         {
             this._description = resourceReader.GetResourceStringIndirect(mshSnapinKey, "DescriptionIndirect", this._assemblyName, this._moduleName);
             this._vendor = resourceReader.GetResourceStringIndirect(mshSnapinKey, "VendorIndirect", this._assemblyName, this._moduleName);
         }
     }
     if (string.IsNullOrEmpty(this._description))
     {
         this._description = this._descriptionFallback;
     }
     if (string.IsNullOrEmpty(this._vendor))
     {
         this._vendor = this._vendorFallback;
     }
 }
Beispiel #8
0
 internal void LoadIndirectResources()
 {
     using (RegistryStringResourceIndirect resourceIndirectReader = RegistryStringResourceIndirect.GetResourceIndirectReader())
         this.LoadIndirectResources(resourceIndirectReader);
 }