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); } }
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); } }
void ILog.Log(DisplayHint hint, string message) { var item = new LogItem(LogFormatter.GetBareString(message), hint); lock (queue) { queue.Enqueue(item); } }
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); }
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); } }
void ILog.Log(DisplayHint hint, string message) { this.EnqueueMessage(LogFormatter.GetBareString(message)); }
// 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 }); }
public LogItem(string message, DisplayHint displayHint) { this.message = message; this.displayHint = displayHint; }
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; } }
void ILog.LogFull(DisplayHint hint, string filter, string alias, string message) { this.EnqueueMessage(LogFormatter.GetLogString(filter, alias, message)); }