コード例 #1
0
ファイル: PSSnapInInfo.cs プロジェクト: modulexcite/pash-1
 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;
     }
 }
コード例 #2
0
ファイル: PSSnapInInfo.cs プロジェクト: modulexcite/pash-1
 internal void LoadIndirectResources()
 {
     using (RegistryStringResourceIndirect indirect = RegistryStringResourceIndirect.GetResourceIndirectReader())
     {
         this.LoadIndirectResources(indirect);
     }
 }
コード例 #3
0
ファイル: PSSnapInCommandBase.cs プロジェクト: nickchal/pash
 protected override void EndProcessing()
 {
     if (this.resourceReader != null)
     {
         this.resourceReader.Dispose();
         this.resourceReader = null;
     }
 }
コード例 #4
0
ファイル: PSSnapInCommandBase.cs プロジェクト: nickchal/pash
 public void Dispose()
 {
     if (!this._disposed)
     {
         if (this.resourceReader != null)
         {
             this.resourceReader.Dispose();
             this.resourceReader = null;
         }
         GC.SuppressFinalize(this);
     }
     this._disposed = true;
 }
コード例 #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);
     }
 }
コード例 #6
0
ファイル: MshSnapinInfo.cs プロジェクト: 40a/PowerShell
        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;
            }
        }
コード例 #7
0
ファイル: PSSnapInInfo.cs プロジェクト: nickchal/pash
 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;
     }
 }
コード例 #8
0
ファイル: PSSnapInInfo.cs プロジェクト: mmoenfly/GitCook2021
 internal void LoadIndirectResources()
 {
     using (RegistryStringResourceIndirect resourceIndirectReader = RegistryStringResourceIndirect.GetResourceIndirectReader())
         this.LoadIndirectResources(resourceIndirectReader);
 }