Example #1
0
 void ILog.Log(DisplayHint hint, string message)
 {
     foreach (var log in logs)
     {
         log.Log(hint, message);
     }
 }
 void ILog.LogFull(DisplayHint hint, string filter, string alias, string message)
 {
     foreach (var log in logs)
     {
         log.LogFull(hint, filter, alias, message);
     }
 }
Example #3
0
 void ILog.LogFull(DisplayHint hint, string filter, string alias, string message)
 {
     foreach (var log in logs)
     {
         log.LogFull(hint, filter, alias, message);
     }
 }
 void ILog.Log(DisplayHint hint, string message)
 {
     foreach (var log in logs)
     {
         log.Log(hint, message);
     }
 }
Example #5
0
        void ILog.LogFull(DisplayHint hint, string filter, string alias, string message)
        {
            var item = new LogItem(LogFormatter.GetLogString(filter, alias, message), hint);

            lock (queue)
            {
                queue.Enqueue(item);
            }
        }
Example #6
0
        void ILog.Log(DisplayHint hint, string message)
        {
            var item = new LogItem(LogFormatter.GetBareString(message), hint);

            lock (queue)
            {
                queue.Enqueue(item);
            }
        }
Example #7
0
        public TextualConvention(IModule module, string name, ISymbolEnumerator symbols)
        {
            _module = module;
            _name   = name;

            _displayHint = ParseDisplayHint(symbols);
            _status      = ParseStatus(symbols);
            _description = ParseDescription(symbols);
            _reference   = ParseReference(symbols);
            _syntax      = ParseSyntax(module, symbols);
        }
Example #8
0
        public TextualConvention(IModule module, string name, ISymbolEnumerator symbols)
        {
            _module = module;
            _name = name;

            _displayHint = ParseDisplayHint(symbols);
            _status      = ParseStatus(symbols);
            _description = ParseDescription(symbols);
            _reference   = ParseReference(symbols);
            _syntax      = ParseSyntax(module, symbols);
        }
Example #9
0
        Color GetColor(DisplayHint hint)
        {
            switch (hint)
            {
            case (DisplayHint.ERROR):
                return(Color.OrangeRed);

            case (DisplayHint.WARNING):
                return(Color.Gold);

            case (DisplayHint.ALT1):
                return(Color.Aqua);

            case (DisplayHint.ALT2):
                return(Color.GreenYellow);

            default:
                return(this.ForeColor);
            }
        }
Example #10
0
 void ILog.Log(DisplayHint hint, string message)
 {
     this.EnqueueMessage(LogFormatter.GetBareString(message));
 }
Example #11
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (Date.Expression != null)
            {
                targetCommand.AddParameter("Date", Date.Get(context));
            }

            if (Year.Expression != null)
            {
                targetCommand.AddParameter("Year", Year.Get(context));
            }

            if (Month.Expression != null)
            {
                targetCommand.AddParameter("Month", Month.Get(context));
            }

            if (Day.Expression != null)
            {
                targetCommand.AddParameter("Day", Day.Get(context));
            }

            if (Hour.Expression != null)
            {
                targetCommand.AddParameter("Hour", Hour.Get(context));
            }

            if (Minute.Expression != null)
            {
                targetCommand.AddParameter("Minute", Minute.Get(context));
            }

            if (Second.Expression != null)
            {
                targetCommand.AddParameter("Second", Second.Get(context));
            }

            if (Millisecond.Expression != null)
            {
                targetCommand.AddParameter("Millisecond", Millisecond.Get(context));
            }

            if (DisplayHint.Expression != null)
            {
                targetCommand.AddParameter("DisplayHint", DisplayHint.Get(context));
            }

            if (UFormat.Expression != null)
            {
                targetCommand.AddParameter("UFormat", UFormat.Get(context));
            }

            if (Format.Expression != null)
            {
                targetCommand.AddParameter("Format", Format.Get(context));
            }


            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
Example #12
0
 public LogItem(string message, DisplayHint displayHint)
 {
     this.message = message;
     this.displayHint = displayHint;
 }
Example #13
0
 Color GetColor(DisplayHint hint)
 {
     switch(hint)
     {
         case(DisplayHint.ERROR):
             return Color.OrangeRed;
         case(DisplayHint.WARNING):
             return Color.Gold;
         case(DisplayHint.ALT1):
             return Color.Aqua;
         case(DisplayHint.ALT2):
             return Color.GreenYellow;
         default:
             return this.ForeColor;
     }
 }
Example #14
0
 void ILog.LogFull(DisplayHint hint, string filter, string alias, string message)
 {
     this.EnqueueMessage(LogFormatter.GetLogString(filter, alias, message));
 }
Example #15
0
 void ILog.Log(DisplayHint hint, string message)
 {
     this.EnqueueMessage(LogFormatter.GetBareString(message));
 }
Example #16
0
 void ILog.LogFull(DisplayHint hint, string filter, string alias, string message)
 {
     this.EnqueueMessage(LogFormatter.GetLogString(filter, alias, message));
 }
Example #17
0
 public LogItem(string message, DisplayHint displayHint)
 {
     this.message     = message;
     this.displayHint = displayHint;
 }