示例#1
0
        /// <summary>
        /// Create a new query object around collected PowerShell runtime data.
        /// </summary>
        /// <param name="runtimeData">The collected PowerShell runtime data object.</param>
        public RuntimeData(Data.RuntimeData runtimeData)
        {
            Types  = new AvailableTypeData(runtimeData.Types);
            Common = new CommonPowerShellData(runtimeData.Common);

            _modules        = new Lazy <IReadOnlyDictionary <string, IReadOnlyDictionary <Version, ModuleData> > >(() => CreateModuleTable(runtimeData.Modules));
            _commands       = new Lazy <IReadOnlyDictionary <string, IReadOnlyList <CommandData> > >(() => CreateCommandLookupTable(Modules));
            _nativeCommands = new Lazy <NativeCommandLookupTable>(() => NativeCommandLookupTable.Create(runtimeData.NativeCommands));
        }
示例#2
0
        /// <summary>
        /// Create a new query object around collected PowerShell runtime data.
        /// </summary>
        /// <param name="runtimeData">The collected PowerShell runtime data object.</param>
        public RuntimeData(Data.RuntimeData runtimeData)
        {
            Types  = new AvailableTypeData(runtimeData.Types);
            Common = new CommonPowerShellData(runtimeData.Common);

            Modules          = CreateModuleTable(runtimeData.Modules);
            NonAliasCommands = CreateNonAliasCommandLookupTable(Modules);
            Aliases          = CreateAliasLookupTable(runtimeData.Modules, NonAliasCommands);
            SetModuleAliases(runtimeData.Modules);
            Commands       = new DualLookupTable <string, IReadOnlyList <CommandData> >(NonAliasCommands, Aliases);
            NativeCommands = NativeCommandLookupTable.Create(runtimeData.NativeCommands);
        }