protected override void ProcessRecord()
        {
            Collection <PSTraceSource> sendToPipeline = null;
            string parameterSetName = base.ParameterSetName;

            if (parameterSetName != null)
            {
                if (!(parameterSetName == "optionsSet"))
                {
                    if (!(parameterSetName == "removeAllListenersSet"))
                    {
                        if (parameterSetName == "removeFileListenersSet")
                        {
                            TraceListenerCommandBase.RemoveListenersByName(base.GetMatchingTraceSource(this.Name, true), this.RemoveFileListener, true);
                        }
                        return;
                    }
                }
                else
                {
                    Collection <PSTraceSource> preconfiguredSources = null;
                    sendToPipeline = base.ConfigureTraceSource(this.Name, true, out preconfiguredSources);
                    if (this.PassThru != 0)
                    {
                        base.WriteObject(sendToPipeline, true);
                        base.WriteObject(preconfiguredSources, true);
                    }
                    return;
                }
                TraceListenerCommandBase.RemoveListenersByName(base.GetMatchingTraceSource(this.Name, true), this.RemoveListener, false);
            }
        }
Beispiel #2
0
 internal TracePipelineWriter(TraceListenerCommandBase cmdlet, bool writeError, Collection<PSTraceSource> matchingSources)
 {
     if (cmdlet == null)
     {
         throw new ArgumentNullException("cmdlet");
     }
     if (matchingSources == null)
     {
         throw new ArgumentNullException("matchingSources");
     }
     this.cmdlet = cmdlet;
     this.writeError = writeError;
     this.matchingSources = matchingSources;
 }
Beispiel #3
0
 internal TracePipelineWriter(TraceListenerCommandBase cmdlet, bool writeError, Collection <PSTraceSource> matchingSources)
 {
     if (cmdlet == null)
     {
         throw new ArgumentNullException("cmdlet");
     }
     if (matchingSources == null)
     {
         throw new ArgumentNullException("matchingSources");
     }
     this.cmdlet          = cmdlet;
     this.writeError      = writeError;
     this.matchingSources = matchingSources;
 }
Beispiel #4
0
        internal TracePipelineWriter(
            TraceListenerCommandBase cmdlet,
            bool writeError,
            Collection <PSTraceSource> matchingSources)
        {
            if (cmdlet == null)
            {
                throw new ArgumentNullException(nameof(cmdlet));
            }

            if (matchingSources == null)
            {
                throw new ArgumentNullException(nameof(matchingSources));
            }

            _cmdlet          = cmdlet;
            _writeError      = writeError;
            _matchingSources = matchingSources;
        }