Example #1
0
        public override InitialSessionStateEntry Clone()
        {
            SessionStateProviderEntry stateProviderEntry = new SessionStateProviderEntry(this.Name, this._implementingType, this._helpFileName, this.Visibility);

            stateProviderEntry.SetPSSnapIn(this.PSSnapIn);
            stateProviderEntry.SetModule(this.Module);
            return((InitialSessionStateEntry)stateProviderEntry);
        }
        private ProviderInfo GetProvider()
        {
            ExecutionContext     executionContext = GetExecutionContext();
            SessionStateInternal sessionState     = new SessionStateInternal(executionContext);

            SessionStateProviderEntry providerEntry = new SessionStateProviderEntry("FileSystem", typeof(FileSystemProvider), null);

            sessionState.AddSessionStateEntry(providerEntry);
            ProviderInfo matchingProvider = sessionState.ProviderList.ToList()[0];

            return(matchingProvider);
        }