示例#1
0
 public SessionStateFormatEntry(FormatTable formattable) : base("*")
 {
     if (formattable == null)
     {
         throw PSTraceSource.NewArgumentNullException("formattable");
     }
     this._formattable = formattable;
 }
示例#2
0
 internal PSSnapInTypeAndFormatErrors(string psSnapinName, FormatTable formatTable)
 {
     this.psSnapinName = psSnapinName;
     FormatTable       = formatTable;
     Errors            = new ConcurrentBag <string>();
 }
 public SessionStateFormatEntry(FormatTable formattable)
     : base("*")
 {
     throw new NotImplementedException();
 }
 internal PSSnapInTypeAndFormatErrors(string psSnapinName, FormatTable formatTable)
 {
     this.psSnapinName = psSnapinName;
     this.formatTable  = formatTable;
     this.errors       = new Collection <string>();
 }
示例#5
0
        private void WaitForComplete()
        {
            if (task != null && !(task.IsCompleted || task.IsCanceled))
                try
                {
                    task.Wait();
                }
                catch(Exception e)
                {
                    Host.UI.WriteLine(ConsoleColor.Red, Host.UI.RawUI.BackgroundColor, "Task faulted.");
                }
            // wait for cancellation token, or service to disconnect
            if (ComputerName.IsNullOrEmpty())
            {
                var trigger = new ManualResetEvent(!PM.IsConnected || PM.ActiveCalls == 0);
                Action whenTriggered = () => trigger.Set();

                PM.Disconnected += whenTriggered;
                PM.Completed += whenTriggered;
                WaitHandle.WaitAny(new[] {trigger});

                PM.Disconnected -= whenTriggered;
                PM.Completed -= whenTriggered;

            }

            foreach (var item in output)
            {
                WriteObject(item);
                FormatTable table = new FormatTable(new string[] {});
            }
        }
示例#6
0
 internal PSSnapInTypeAndFormatErrors(string psSnapinName, FormatTable formatTable)
 {
     this.psSnapinName = psSnapinName;
     FormatTable = formatTable;
     Errors = new ConcurrentBag<string>();
 }