Esempio n. 1
0
 private void AddCmdletToCache(CmdletConfigurationEntry entry)
 {
     if (!this.IsSpecialCmdlet(entry.ImplementingType))
     {
         CmdletInfo newCmdletInfo = this.NewCmdletInfo(entry, SessionStateEntryVisibility.Public);
         this.AddCmdletInfoToCache(newCmdletInfo.Name, newCmdletInfo, true);
     }
 }
Esempio n. 2
0
        private void MergeCustomPSSnapIn(PSSnapInInfo mshsnapinInfo, CustomPSSnapIn customPSSnapIn)
        {
            if (mshsnapinInfo == null || customPSSnapIn == null)
            {
                return;
            }

            s_mshsnapinTracer.WriteLine("Merging configuration from custom mshsnapin {0}", mshsnapinInfo.Name);

            if (customPSSnapIn.Cmdlets != null)
            {
                foreach (CmdletConfigurationEntry entry in customPSSnapIn.Cmdlets)
                {
                    CmdletConfigurationEntry cmdlet = new CmdletConfigurationEntry(entry.Name, entry.ImplementingType, entry.HelpFileName, mshsnapinInfo);
                    _cmdlets.AddBuiltInItem(cmdlet);
                }
            }

            if (customPSSnapIn.Providers != null)
            {
                foreach (ProviderConfigurationEntry entry in customPSSnapIn.Providers)
                {
                    ProviderConfigurationEntry provider = new ProviderConfigurationEntry(entry.Name, entry.ImplementingType, entry.HelpFileName, mshsnapinInfo);
                    _providers.AddBuiltInItem(provider);
                }
            }

            if (customPSSnapIn.Types != null)
            {
                foreach (TypeConfigurationEntry entry in customPSSnapIn.Types)
                {
                    string path = Path.Combine(mshsnapinInfo.ApplicationBase, entry.FileName);
                    TypeConfigurationEntry type = new TypeConfigurationEntry(entry.Name, path, mshsnapinInfo);
                    _types.AddBuiltInItem(type);
                }
            }

            if (customPSSnapIn.Formats != null)
            {
                foreach (FormatConfigurationEntry entry in customPSSnapIn.Formats)
                {
                    string path = Path.Combine(mshsnapinInfo.ApplicationBase, entry.FileName);
                    FormatConfigurationEntry format = new FormatConfigurationEntry(entry.Name, path, mshsnapinInfo);
                    _formats.AddBuiltInItem(format);
                }
            }

            AssemblyConfigurationEntry assemblyEntry = new AssemblyConfigurationEntry(mshsnapinInfo.AssemblyName, mshsnapinInfo.AbsoluteModulePath, mshsnapinInfo);

            this.Assemblies.AddBuiltInItem(assemblyEntry);

            s_mshsnapinTracer.WriteLine("Configuration from custom mshsnapin {0} merged", mshsnapinInfo.Name);
        }
Esempio n. 3
0
 private void MergeCustomPSSnapIn(PSSnapInInfo mshsnapinInfo, CustomPSSnapIn customPSSnapIn)
 {
     if ((mshsnapinInfo != null) && (customPSSnapIn != null))
     {
         _mshsnapinTracer.WriteLine("Merging configuration from custom mshsnapin {0}", new object[] { mshsnapinInfo.Name });
         if (customPSSnapIn.Cmdlets != null)
         {
             foreach (CmdletConfigurationEntry entry in customPSSnapIn.Cmdlets)
             {
                 CmdletConfigurationEntry entry2 = new CmdletConfigurationEntry(entry.Name, entry.ImplementingType, entry.HelpFileName, mshsnapinInfo);
                 this._cmdlets.AddBuiltInItem(entry2);
             }
         }
         if (customPSSnapIn.Providers != null)
         {
             foreach (ProviderConfigurationEntry entry3 in customPSSnapIn.Providers)
             {
                 ProviderConfigurationEntry entry4 = new ProviderConfigurationEntry(entry3.Name, entry3.ImplementingType, entry3.HelpFileName, mshsnapinInfo);
                 this._providers.AddBuiltInItem(entry4);
             }
         }
         if (customPSSnapIn.Types != null)
         {
             foreach (TypeConfigurationEntry entry5 in customPSSnapIn.Types)
             {
                 string fileName = Path.Combine(mshsnapinInfo.ApplicationBase, entry5.FileName);
                 TypeConfigurationEntry entry6 = new TypeConfigurationEntry(entry5.Name, fileName, mshsnapinInfo);
                 this._types.AddBuiltInItem(entry6);
             }
         }
         if (customPSSnapIn.Formats != null)
         {
             foreach (FormatConfigurationEntry entry7 in customPSSnapIn.Formats)
             {
                 string str2 = Path.Combine(mshsnapinInfo.ApplicationBase, entry7.FileName);
                 FormatConfigurationEntry entry8 = new FormatConfigurationEntry(entry7.Name, str2, mshsnapinInfo);
                 this._formats.AddBuiltInItem(entry8);
             }
         }
         AssemblyConfigurationEntry item = new AssemblyConfigurationEntry(mshsnapinInfo.AssemblyName, mshsnapinInfo.AbsoluteModulePath, mshsnapinInfo);
         this.Assemblies.AddBuiltInItem(item);
         _mshsnapinTracer.WriteLine("Configuration from custom mshsnapin {0} merged", new object[] { mshsnapinInfo.Name });
     }
 }
Esempio n. 4
0
 private void RemoveCmdletFromCache(CmdletConfigurationEntry entry)
 {
     IDictionary<string, List<CmdletInfo>> cmdletTable = this._context.EngineSessionState.GetCmdletTable();
     if (cmdletTable.ContainsKey(entry.Name))
     {
         List<CmdletInfo> cacheEntry = cmdletTable[entry.Name];
         int cmdletRemovalIndex = this.GetCmdletRemovalIndex(cacheEntry, (entry.PSSnapIn == null) ? string.Empty : entry.PSSnapIn.Name);
         if (cmdletRemovalIndex >= 0)
         {
             string name = cacheEntry[cmdletRemovalIndex].Name;
             cacheEntry.RemoveAt(cmdletRemovalIndex);
             this._context.EngineSessionState.RemoveCmdlet(name, cmdletRemovalIndex, true);
         }
         if (cacheEntry.Count == 0)
         {
             this._context.EngineSessionState.RemoveCmdletEntry(entry.Name, true);
         }
     }
 }
Esempio n. 5
0
 private CmdletInfo NewCmdletInfo(CmdletConfigurationEntry entry, SessionStateEntryVisibility visibility)
 {
     return new CmdletInfo(entry.Name, entry.ImplementingType, entry.HelpFileName, entry.PSSnapIn, this._context) { Visibility = visibility };
 }
        private void MergeCustomPSSnapIn(PSSnapInInfo mshsnapinInfo, CustomPSSnapIn customPSSnapIn)
        {
            if (mshsnapinInfo == null || customPSSnapIn == null)
                return;

            s_mshsnapinTracer.WriteLine("Merging configuration from custom mshsnapin {0}", mshsnapinInfo.Name);

            if (customPSSnapIn.Cmdlets != null)
            {
                foreach (CmdletConfigurationEntry entry in customPSSnapIn.Cmdlets)
                {
                    CmdletConfigurationEntry cmdlet = new CmdletConfigurationEntry(entry.Name, entry.ImplementingType, entry.HelpFileName, mshsnapinInfo);
                    _cmdlets.AddBuiltInItem(cmdlet);
                }
            }

            if (customPSSnapIn.Providers != null)
            {
                foreach (ProviderConfigurationEntry entry in customPSSnapIn.Providers)
                {
                    ProviderConfigurationEntry provider = new ProviderConfigurationEntry(entry.Name, entry.ImplementingType, entry.HelpFileName, mshsnapinInfo);
                    _providers.AddBuiltInItem(provider);
                }
            }

            if (customPSSnapIn.Types != null)
            {
                foreach (TypeConfigurationEntry entry in customPSSnapIn.Types)
                {
                    string path = Path.Combine(mshsnapinInfo.ApplicationBase, entry.FileName);
                    TypeConfigurationEntry type = new TypeConfigurationEntry(entry.Name, path, mshsnapinInfo);
                    _types.AddBuiltInItem(type);
                }
            }

            if (customPSSnapIn.Formats != null)
            {
                foreach (FormatConfigurationEntry entry in customPSSnapIn.Formats)
                {
                    string path = Path.Combine(mshsnapinInfo.ApplicationBase, entry.FileName);
                    FormatConfigurationEntry format = new FormatConfigurationEntry(entry.Name, path, mshsnapinInfo);
                    _formats.AddBuiltInItem(format);
                }
            }

            AssemblyConfigurationEntry assemblyEntry = new AssemblyConfigurationEntry(mshsnapinInfo.AssemblyName, mshsnapinInfo.AbsoluteModulePath, mshsnapinInfo);
            this.Assemblies.AddBuiltInItem(assemblyEntry);

            s_mshsnapinTracer.WriteLine("Configuration from custom mshsnapin {0} merged", mshsnapinInfo.Name);
        }
        private void LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
        {
            if (mshsnapinInfo == null)
                return;

#if !CORECLR // CustomPSSnapIn Not Supported On CSS. 
            if (!String.IsNullOrEmpty(mshsnapinInfo.CustomPSSnapInType))
            {
                LoadCustomPSSnapIn(mshsnapinInfo);
                return;
            }
#endif
            Assembly assembly = null;

            s_mshsnapinTracer.WriteLine("Loading assembly for mshsnapin {0}", mshsnapinInfo.Name);

            assembly = LoadMshSnapinAssembly(mshsnapinInfo);

            if (assembly == null)
            {
                s_mshsnapinTracer.TraceError("Loading assembly for mshsnapin {0} failed", mshsnapinInfo.Name);
                return;
            }

            s_mshsnapinTracer.WriteLine("Loading assembly for mshsnapin {0} succeeded", mshsnapinInfo.Name);

            Dictionary<string, SessionStateCmdletEntry> cmdlets = null;
            Dictionary<string, List<SessionStateAliasEntry>> aliases = null;
            Dictionary<string, SessionStateProviderEntry> providers = null;
            string throwAwayHelpFile = null;
            PSSnapInHelpers.AnalyzePSSnapInAssembly(assembly, assembly.Location, mshsnapinInfo, null, false, out cmdlets, out aliases, out providers, out throwAwayHelpFile);
            if (cmdlets != null)
            {
                foreach (var c in cmdlets)
                {
                    CmdletConfigurationEntry cmdlet = new CmdletConfigurationEntry(c.Key, c.Value.ImplementingType,
                                                                                   c.Value.HelpFileName, mshsnapinInfo);
                    _cmdlets.AddBuiltInItem(cmdlet);
                }
            }
            if (providers != null)
            {
                foreach (var p in providers)
                {
                    ProviderConfigurationEntry provider = new ProviderConfigurationEntry(p.Key, p.Value.ImplementingType,
                                                                                         p.Value.HelpFileName,
                                                                                         mshsnapinInfo);
                    _providers.AddBuiltInItem(provider);
                }
            }

            foreach (string file in mshsnapinInfo.Types)
            {
                string path = Path.Combine(mshsnapinInfo.ApplicationBase, file);

                TypeConfigurationEntry typeEntry = new TypeConfigurationEntry(path, path, mshsnapinInfo);
                this.Types.AddBuiltInItem(typeEntry);
            }

            foreach (string file in mshsnapinInfo.Formats)
            {
                string path = Path.Combine(mshsnapinInfo.ApplicationBase, file);

                FormatConfigurationEntry formatEntry = new FormatConfigurationEntry(path, path, mshsnapinInfo);
                this.Formats.AddBuiltInItem(formatEntry);
            }

            AssemblyConfigurationEntry assemblyEntry = new AssemblyConfigurationEntry(mshsnapinInfo.AssemblyName, mshsnapinInfo.AbsoluteModulePath, mshsnapinInfo);
            this.Assemblies.AddBuiltInItem(assemblyEntry);

            return;
        }
Esempio n. 8
0
 private void AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
 {
     if (assembly != null)
     {
         _mshsnapinTracer.WriteLine("Analyzing assembly {0} for cmdlet and providers", new object[] { assembly.Location });
         string helpFile      = GetHelpFile(assembly.Location);
         Type[] exportedTypes = null;
         try
         {
             exportedTypes = assembly.GetExportedTypes();
         }
         catch (ReflectionTypeLoadException exception)
         {
             string errorMessageFormat = exception.Message + "\nLoader Exceptions: \n";
             if (exception.LoaderExceptions != null)
             {
                 foreach (Exception exception2 in exception.LoaderExceptions)
                 {
                     errorMessageFormat = errorMessageFormat + "\n" + exception2.Message;
                 }
             }
             _mshsnapinTracer.TraceError(errorMessageFormat, new object[0]);
             throw new PSSnapInException(mshsnapinInfo.Name, errorMessageFormat);
         }
         Hashtable hashtable  = new Hashtable(StringComparer.OrdinalIgnoreCase);
         Hashtable hashtable2 = new Hashtable(StringComparer.OrdinalIgnoreCase);
         foreach (Type type in exportedTypes)
         {
             string   cmdletName       = null;
             string   providerName     = null;
             object[] customAttributes = type.GetCustomAttributes(typeof(CmdletAttribute), false);
             if (customAttributes.Length > 0)
             {
                 cmdletName = GetCmdletName(customAttributes[0] as CmdletAttribute);
             }
             else
             {
                 customAttributes = type.GetCustomAttributes(typeof(CmdletProviderAttribute), false);
                 if (customAttributes.Length > 0)
                 {
                     providerName = GetProviderName(customAttributes[0] as CmdletProviderAttribute);
                 }
             }
             if (!string.IsNullOrEmpty(cmdletName))
             {
                 if (IsCmdletClass(type) && HasDefaultConstructor(type))
                 {
                     if (hashtable.ContainsKey(cmdletName))
                     {
                         string str5 = StringUtil.Format(ConsoleInfoErrorStrings.PSSnapInDuplicateCmdlets, cmdletName, mshsnapinInfo.Name);
                         _mshsnapinTracer.TraceError(str5, new object[0]);
                         throw new PSSnapInException(mshsnapinInfo.Name, str5);
                     }
                     hashtable.Add(cmdletName, null);
                     CmdletConfigurationEntry item = new CmdletConfigurationEntry(cmdletName, type, helpFile, mshsnapinInfo);
                     this._cmdlets.AddBuiltInItem(item);
                     _mshsnapinTracer.WriteLine("{0} from type {1} is added as a cmdlet. ", new object[] { cmdletName, type.FullName });
                     continue;
                 }
                 _mshsnapinTracer.TraceWarning("{0} is not valid cmdlet because it doesn't derive from the Cmdlet type or it doesn't have a default constructor.", new object[] { cmdletName });
             }
             if (!string.IsNullOrEmpty(providerName))
             {
                 if (IsProviderClass(type) && HasDefaultConstructor(type))
                 {
                     if (hashtable2.ContainsKey(providerName))
                     {
                         string str6 = StringUtil.Format(ConsoleInfoErrorStrings.PSSnapInDuplicateProviders, providerName, mshsnapinInfo.Name);
                         _mshsnapinTracer.TraceError(str6, new object[0]);
                         throw new PSSnapInException(mshsnapinInfo.Name, str6);
                     }
                     hashtable2.Add(providerName, null);
                     ProviderConfigurationEntry entry2 = new ProviderConfigurationEntry(providerName, type, helpFile, mshsnapinInfo);
                     this._providers.AddBuiltInItem(entry2);
                     _mshsnapinTracer.WriteLine("{0} from type {1} is added as a provider. ", new object[] { providerName, type.FullName });
                     continue;
                 }
                 _mshsnapinTracer.TraceWarning("{0} is not valid provider because it doesn't derive from the provider type or it doesn't have a default constructor.", new object[] { providerName });
             }
             if (typeof(IModuleAssemblyInitializer).IsAssignableFrom(type) && !type.Equals(typeof(IModuleAssemblyInitializer)))
             {
                 _mshsnapinTracer.TraceWarning("Calling module initializer defined by type {0}", new object[] { type.FullName });
                 (Activator.CreateInstance(type, true) as IModuleAssemblyInitializer).OnImport();
             }
         }
     }
 }
 private void MergeCustomPSSnapIn(PSSnapInInfo mshsnapinInfo, CustomPSSnapIn customPSSnapIn)
 {
     if ((mshsnapinInfo != null) && (customPSSnapIn != null))
     {
         _mshsnapinTracer.WriteLine("Merging configuration from custom mshsnapin {0}", new object[] { mshsnapinInfo.Name });
         if (customPSSnapIn.Cmdlets != null)
         {
             foreach (CmdletConfigurationEntry entry in customPSSnapIn.Cmdlets)
             {
                 CmdletConfigurationEntry entry2 = new CmdletConfigurationEntry(entry.Name, entry.ImplementingType, entry.HelpFileName, mshsnapinInfo);
                 this._cmdlets.AddBuiltInItem(entry2);
             }
         }
         if (customPSSnapIn.Providers != null)
         {
             foreach (ProviderConfigurationEntry entry3 in customPSSnapIn.Providers)
             {
                 ProviderConfigurationEntry entry4 = new ProviderConfigurationEntry(entry3.Name, entry3.ImplementingType, entry3.HelpFileName, mshsnapinInfo);
                 this._providers.AddBuiltInItem(entry4);
             }
         }
         if (customPSSnapIn.Types != null)
         {
             foreach (TypeConfigurationEntry entry5 in customPSSnapIn.Types)
             {
                 string fileName = Path.Combine(mshsnapinInfo.ApplicationBase, entry5.FileName);
                 TypeConfigurationEntry entry6 = new TypeConfigurationEntry(entry5.Name, fileName, mshsnapinInfo);
                 this._types.AddBuiltInItem(entry6);
             }
         }
         if (customPSSnapIn.Formats != null)
         {
             foreach (FormatConfigurationEntry entry7 in customPSSnapIn.Formats)
             {
                 string str2 = Path.Combine(mshsnapinInfo.ApplicationBase, entry7.FileName);
                 FormatConfigurationEntry entry8 = new FormatConfigurationEntry(entry7.Name, str2, mshsnapinInfo);
                 this._formats.AddBuiltInItem(entry8);
             }
         }
         AssemblyConfigurationEntry item = new AssemblyConfigurationEntry(mshsnapinInfo.AssemblyName, mshsnapinInfo.AbsoluteModulePath, mshsnapinInfo);
         this.Assemblies.AddBuiltInItem(item);
         _mshsnapinTracer.WriteLine("Configuration from custom mshsnapin {0} merged", new object[] { mshsnapinInfo.Name });
     }
 }
 private void AnalyzeMshSnapinAssembly(Assembly assembly, PSSnapInInfo mshsnapinInfo)
 {
     if (assembly != null)
     {
         _mshsnapinTracer.WriteLine("Analyzing assembly {0} for cmdlet and providers", new object[] { assembly.Location });
         string helpFile = GetHelpFile(assembly.Location);
         Type[] exportedTypes = null;
         try
         {
             exportedTypes = assembly.GetExportedTypes();
         }
         catch (ReflectionTypeLoadException exception)
         {
             string errorMessageFormat = exception.Message + "\nLoader Exceptions: \n";
             if (exception.LoaderExceptions != null)
             {
                 foreach (Exception exception2 in exception.LoaderExceptions)
                 {
                     errorMessageFormat = errorMessageFormat + "\n" + exception2.Message;
                 }
             }
             _mshsnapinTracer.TraceError(errorMessageFormat, new object[0]);
             throw new PSSnapInException(mshsnapinInfo.Name, errorMessageFormat);
         }
         Hashtable hashtable = new Hashtable(StringComparer.OrdinalIgnoreCase);
         Hashtable hashtable2 = new Hashtable(StringComparer.OrdinalIgnoreCase);
         foreach (Type type in exportedTypes)
         {
             string cmdletName = null;
             string providerName = null;
             object[] customAttributes = type.GetCustomAttributes(typeof(CmdletAttribute), false);
             if (customAttributes.Length > 0)
             {
                 cmdletName = GetCmdletName(customAttributes[0] as CmdletAttribute);
             }
             else
             {
                 customAttributes = type.GetCustomAttributes(typeof(CmdletProviderAttribute), false);
                 if (customAttributes.Length > 0)
                 {
                     providerName = GetProviderName(customAttributes[0] as CmdletProviderAttribute);
                 }
             }
             if (!string.IsNullOrEmpty(cmdletName))
             {
                 if (IsCmdletClass(type) && HasDefaultConstructor(type))
                 {
                     if (hashtable.ContainsKey(cmdletName))
                     {
                         string str5 = StringUtil.Format(ConsoleInfoErrorStrings.PSSnapInDuplicateCmdlets, cmdletName, mshsnapinInfo.Name);
                         _mshsnapinTracer.TraceError(str5, new object[0]);
                         throw new PSSnapInException(mshsnapinInfo.Name, str5);
                     }
                     hashtable.Add(cmdletName, null);
                     CmdletConfigurationEntry item = new CmdletConfigurationEntry(cmdletName, type, helpFile, mshsnapinInfo);
                     this._cmdlets.AddBuiltInItem(item);
                     _mshsnapinTracer.WriteLine("{0} from type {1} is added as a cmdlet. ", new object[] { cmdletName, type.FullName });
                     continue;
                 }
                 _mshsnapinTracer.TraceWarning("{0} is not valid cmdlet because it doesn't derive from the Cmdlet type or it doesn't have a default constructor.", new object[] { cmdletName });
             }
             if (!string.IsNullOrEmpty(providerName))
             {
                 if (IsProviderClass(type) && HasDefaultConstructor(type))
                 {
                     if (hashtable2.ContainsKey(providerName))
                     {
                         string str6 = StringUtil.Format(ConsoleInfoErrorStrings.PSSnapInDuplicateProviders, providerName, mshsnapinInfo.Name);
                         _mshsnapinTracer.TraceError(str6, new object[0]);
                         throw new PSSnapInException(mshsnapinInfo.Name, str6);
                     }
                     hashtable2.Add(providerName, null);
                     ProviderConfigurationEntry entry2 = new ProviderConfigurationEntry(providerName, type, helpFile, mshsnapinInfo);
                     this._providers.AddBuiltInItem(entry2);
                     _mshsnapinTracer.WriteLine("{0} from type {1} is added as a provider. ", new object[] { providerName, type.FullName });
                     continue;
                 }
                 _mshsnapinTracer.TraceWarning("{0} is not valid provider because it doesn't derive from the provider type or it doesn't have a default constructor.", new object[] { providerName });
             }
             if (typeof(IModuleAssemblyInitializer).IsAssignableFrom(type) && !type.Equals(typeof(IModuleAssemblyInitializer)))
             {
                 _mshsnapinTracer.TraceWarning("Calling module initializer defined by type {0}", new object[] { type.FullName });
                 (Activator.CreateInstance(type, true) as IModuleAssemblyInitializer).OnImport();
             }
         }
     }
 }
Esempio n. 11
0
        private void LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)
        {
            if (mshsnapinInfo == null)
            {
                return;
            }

#if !CORECLR // CustomPSSnapIn Not Supported On CSS.
            if (!String.IsNullOrEmpty(mshsnapinInfo.CustomPSSnapInType))
            {
                LoadCustomPSSnapIn(mshsnapinInfo);
                return;
            }
#endif
            Assembly assembly = null;

            s_mshsnapinTracer.WriteLine("Loading assembly for mshsnapin {0}", mshsnapinInfo.Name);

            assembly = LoadMshSnapinAssembly(mshsnapinInfo);

            if (assembly == null)
            {
                s_mshsnapinTracer.TraceError("Loading assembly for mshsnapin {0} failed", mshsnapinInfo.Name);
                return;
            }

            s_mshsnapinTracer.WriteLine("Loading assembly for mshsnapin {0} succeeded", mshsnapinInfo.Name);

            Dictionary <string, SessionStateCmdletEntry>        cmdlets   = null;
            Dictionary <string, List <SessionStateAliasEntry> > aliases   = null;
            Dictionary <string, SessionStateProviderEntry>      providers = null;
            string throwAwayHelpFile = null;
            PSSnapInHelpers.AnalyzePSSnapInAssembly(assembly, assembly.Location, mshsnapinInfo, null, false, out cmdlets, out aliases, out providers, out throwAwayHelpFile);
            if (cmdlets != null)
            {
                foreach (var c in cmdlets)
                {
                    CmdletConfigurationEntry cmdlet = new CmdletConfigurationEntry(c.Key, c.Value.ImplementingType,
                                                                                   c.Value.HelpFileName, mshsnapinInfo);
                    _cmdlets.AddBuiltInItem(cmdlet);
                }
            }
            if (providers != null)
            {
                foreach (var p in providers)
                {
                    ProviderConfigurationEntry provider = new ProviderConfigurationEntry(p.Key, p.Value.ImplementingType,
                                                                                         p.Value.HelpFileName,
                                                                                         mshsnapinInfo);
                    _providers.AddBuiltInItem(provider);
                }
            }

            foreach (string file in mshsnapinInfo.Types)
            {
                string path = Path.Combine(mshsnapinInfo.ApplicationBase, file);

                TypeConfigurationEntry typeEntry = new TypeConfigurationEntry(path, path, mshsnapinInfo);
                this.Types.AddBuiltInItem(typeEntry);
            }

            foreach (string file in mshsnapinInfo.Formats)
            {
                string path = Path.Combine(mshsnapinInfo.ApplicationBase, file);

                FormatConfigurationEntry formatEntry = new FormatConfigurationEntry(path, path, mshsnapinInfo);
                this.Formats.AddBuiltInItem(formatEntry);
            }

            AssemblyConfigurationEntry assemblyEntry = new AssemblyConfigurationEntry(mshsnapinInfo.AssemblyName, mshsnapinInfo.AbsoluteModulePath, mshsnapinInfo);
            this.Assemblies.AddBuiltInItem(assemblyEntry);

            return;
        }