示例#1
0
        public override void Dispose()
        {
            base.Dispose();

            CommandsSource.RaiseOnEndScopeCommand(_commandsSource, Context, new LogScopeCommandArgs(this));

            Context.Log = Parent;
        }
示例#2
0
        public BaseLogScope(ILogContext logContext, IExtensionManager extensionManager, CommandsSource commandsSource)
        {
            Context           = logContext;
            _extensionManager = extensionManager;
            _commandsSource   = commandsSource;

            BeginTime = DateTime.UtcNow;
        }
 void DialogContentControl_KeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key == VirtualKey.Enter)
     {
         CommandsSource.FirstOrDefault(x => x.IsDefault).Do(x => { e.Handled = true; DialogResultCommand.Execute(x); });
     }
     else if (e.Key == VirtualKey.Escape)
     {
         CommandsSource.FirstOrDefault(x => x.IsCancel).Do(x => { e.Handled = true; DialogResultCommand.Execute(x); });
     }
 }
示例#4
0
        public LogScope(ILogContext logContext, IExtensionManager extensionManager, CommandsSource commandsSource, ILogScope root, ILogScope parent, string name) : base(logContext, extensionManager, commandsSource)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("Log scope name cannot be null of empty.", nameof(name));
            }

            Root   = root;
            Parent = parent;
            Name   = name;

            CommandsSource.RaiseOnBeginScopeCommand(commandsSource, logContext, new LogScopeCommandArgs(this));
        }
示例#5
0
 public RootLogScope(ILogContext logContext, IExtensionManager extensionManager, CommandsSource commandsSource) : base(logContext, extensionManager, commandsSource)
 {
 }
示例#6
0
 public virtual void Message(ILogMessage log)
 {
     CommandsSource.RaiseOnLogMessageCommand(_commandsSource, Context, new Extensibility.Commands.CommandArgs.LogMessageCommandArgs(this, log));
 }