public KernelOutputFilterViewModel(Guid id)
 {
     _id       = id;
     this.Save = new DelegateCommand(() => {
         if (NTMinerRoot.Current.KernelOutputFilterSet.Contains(this.Id))
         {
             Global.Execute(new UpdateKernelOutputFilterCommand(this));
         }
         else
         {
             Global.Execute(new AddKernelOutputFilterCommand(this));
         }
         CloseWindow?.Invoke();
     });
     this.Edit = new DelegateCommand(() => {
         KernelOutputFilterEdit.ShowEditWindow(this);
     });
     this.Remove = new DelegateCommand(() => {
         if (this.Id == Guid.Empty)
         {
             return;
         }
         DialogWindow.ShowDialog(message: $"您确定删除{this.RegexPattern}内核输出过滤器吗?", title: "确认", onYes: () => {
             Global.Execute(new RemoveKernelOutputFilterCommand(this.Id));
         }, icon: "Icon_Confirm");
     });
 }
示例#2
0
 public KernelOutputFilterViewModel(Guid id)
 {
     _id       = id;
     this.Edit = new DelegateCommand(() => {
         KernelOutputFilterEdit.ShowEditWindow(this);
     });
     this.Remove = new DelegateCommand(() => {
         if (this.Id == Guid.Empty)
         {
             return;
         }
         DialogWindow.ShowDialog(message: $"您确定删除{this.RegexPattern}内核输出过滤器吗?", title: "确认", onYes: () => {
             Global.Execute(new RemoveKernelOutputFilterCommand(this.Id));
         }, icon: "Icon_Confirm");
     });
 }