Esempio n. 1
0
 public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm)
 {
     InitializeComponent();
     if (selectedKernelOutputVm != null)
     {
         Vm.CurrentKernelOutputVm = selectedKernelOutputVm;
     }
 }
Esempio n. 2
0
 public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm)
 {
     if (selectedKernelOutputVm != null)
     {
         KernelOutputPageViewModel.Current.CurrentKernelOutputVm = selectedKernelOutputVm;
     }
     InitializeComponent();
     ResourceDictionarySet.Instance.FillResourceDic(this, this.Resources);
 }
Esempio n. 3
0
 public static void ShowWindow(KernelOutputViewModel selectedKernelOutputVm)
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         IconName      = "Icon_KernelOutput",
         CloseVisible  = System.Windows.Visibility.Visible,
         FooterVisible = System.Windows.Visibility.Collapsed,
         Width         = 960,
         Height        = 720
     },
                                ucFactory: (window) => new KernelOutputPage(selectedKernelOutputVm));
 }
Esempio n. 4
0
            private KernelOutputViewModels()
            {
                if (WpfUtil.IsInDesignMode)
                {
                    return;
                }
#if DEBUG
                NTStopwatch.Start();
#endif
                VirtualRoot.AddEventPath <ServerContextReInitedEvent>("ServerContext刷新后刷新VM内存", LogEnum.DevConsole,
                                                                      action: message => {
                    _dicById.Clear();
                    Init();
                }, location: this.GetType());
                VirtualRoot.AddEventPath <ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                                                                         action: message => {
                    AllPropertyChanged();
                }, location: this.GetType());
                AddEventPath <KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                                      action: message => {
                    var vm = new KernelOutputViewModel(message.Source);
                    _dicById.Add(message.Source.GetId(), vm);
                    OnPropertyChanged(nameof(AllKernelOutputVms));
                    OnPropertyChanged(nameof(PleaseSelectVms));
                }, location: this.GetType());
                AddEventPath <KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                                        action: message => {
                    if (_dicById.TryGetValue(message.Source.GetId(), out KernelOutputViewModel vm))
                    {
                        if (vm != null)
                        {
                            vm.Update(message.Source);
                        }
                    }
                }, location: this.GetType());
                AddEventPath <KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                                        action: message => {
                    if (_dicById.ContainsKey(message.Source.GetId()))
                    {
                        _dicById.Remove(message.Source.GetId());
                        OnPropertyChanged(nameof(AllKernelOutputVms));
                        OnPropertyChanged(nameof(PleaseSelectVms));
                    }
                }, location: this.GetType());
                Init();
#if DEBUG
                var elapsedMilliseconds = NTStopwatch.Stop();
                if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds)
                {
                    Write.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.ctor");
                }
#endif
            }
Esempio n. 5
0
 public static void ShowEditWindow(KernelOutputViewModel source)
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         IsDialogWindow = true,
         CloseVisible   = System.Windows.Visibility.Visible,
         IconName       = "Icon_KernelOutput"
     }, ucFactory: (window) =>
     {
         KernelOutputViewModel vm = new KernelOutputViewModel(source);
         vm.CloseWindow           = () => window.Close();
         return(new KernelOutputEdit(vm));
     }, fixedSize: true);
 }
Esempio n. 6
0
 public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm)
 {
     if (WpfUtil.IsInDesignMode)
     {
         return;
     }
     this.Vm          = new KernelOutputPageViewModel();
     this.DataContext = this.Vm;
     InitializeComponent();
     if (selectedKernelOutputVm != null)
     {
         Vm.CurrentKernelOutputVm = selectedKernelOutputVm;
     }
 }
Esempio n. 7
0
 public static void ShowWindow(FormType formType, KernelOutputViewModel source)
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title           = "内核输出",
         FormType        = formType,
         IsMaskTheParent = true,
         Width           = 900,
         CloseVisible    = System.Windows.Visibility.Visible,
         IconName        = "Icon_KernelOutput"
     }, ucFactory: (window) =>
     {
         KernelOutputViewModel vm = new KernelOutputViewModel(source);
         window.AddCloseWindowOnecePath(vm.Id);
         return(new KernelOutputEdit(vm));
     }, fixedSize: true);
 }
Esempio n. 8
0
            private KernelOutputViewModels()
            {
#if DEBUG
                Write.Stopwatch.Restart();
#endif
                VirtualRoot.On <ServerContextReInitedEvent>("ServerContext刷新后刷新VM内存", LogEnum.DevConsole,
                                                            action: message => {
                    _dicById.Clear();
                    Init();
                });
                VirtualRoot.On <ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                                                               action: message => {
                    AllPropertyChanged();
                });
                On <KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                            action: message => {
                    var vm = new KernelOutputViewModel(message.Source);
                    _dicById.Add(message.Source.GetId(), vm);
                    OnPropertyChanged(nameof(AllKernelOutputVms));
                    OnPropertyChanged(nameof(PleaseSelectVms));
                });
                On <KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                              action: message => {
                    if (_dicById.ContainsKey(message.Source.GetId()))
                    {
                        var item = _dicById[message.Source.GetId()];
                        if (item != null)
                        {
                            item.Update(message.Source);
                        }
                    }
                });
                On <KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                              action: message => {
                    if (_dicById.ContainsKey(message.Source.GetId()))
                    {
                        _dicById.Remove(message.Source.GetId());
                        OnPropertyChanged(nameof(AllKernelOutputVms));
                        OnPropertyChanged(nameof(PleaseSelectVms));
                    }
                });
                Init();
#if DEBUG
                Write.DevTimeSpan($"耗时{Write.Stopwatch.ElapsedMilliseconds}毫秒 {this.GetType().Name}.ctor");
#endif
            }
Esempio n. 9
0
 public static void ShowWindow(FormType formType, KernelOutputViewModel source)
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title          = "内核输出",
         FormType       = formType,
         IsDialogWindow = true,
         Width          = 900,
         CloseVisible   = System.Windows.Visibility.Visible,
         IconName       = "Icon_KernelOutput"
     }, ucFactory: (window) =>
     {
         KernelOutputViewModel vm = new KernelOutputViewModel(source)
         {
             CloseWindow = () => window.Close()
         };
         return(new KernelOutputEdit(vm));
     }, fixedSize: true);
 }
Esempio n. 10
0
 public static void ShowWindow(FormType formType, KernelOutputViewModel source)
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title           = "内核输出",
         FormType        = formType,
         IsMaskTheParent = true,
         Width           = 900,
         CloseVisible    = System.Windows.Visibility.Visible,
         IconName        = "Icon_KernelOutput"
     }, ucFactory: (window) =>
     {
         KernelOutputViewModel vm = new KernelOutputViewModel(source);
         window.AddOnecePath <CloseWindowCommand>("处理关闭窗口命令", LogEnum.DevConsole, action: message => {
             window.Close();
         }, pathId: vm.Id, location: typeof(KernelOutputEdit));
         return(new KernelOutputEdit(vm));
     }, fixedSize: true);
 }
 private KernelOutputViewModels()
 {
     if (WpfUtil.IsInDesignMode)
     {
         return;
     }
     VirtualRoot.AddEventPath <ServerContextReInitedEvent>("ServerContext刷新后刷新VM内存", LogEnum.DevConsole,
                                                           action: message => {
         _dicById.Clear();
         Init();
     }, location: this.GetType());
     VirtualRoot.AddEventPath <ServerContextReInitedEventHandledEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                                                                       action: message => {
         AllPropertyChanged();
     }, location: this.GetType());
     AddEventPath <KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                           action: message => {
         var vm = new KernelOutputViewModel(message.Source);
         _dicById.Add(message.Source.GetId(), vm);
         OnPropertyChanged(nameof(AllKernelOutputVms));
         OnPropertyChanged(nameof(PleaseSelectVms));
     }, location: this.GetType());
     AddEventPath <KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                             action: message => {
         if (_dicById.TryGetValue(message.Source.GetId(), out KernelOutputViewModel vm))
         {
             if (vm != null)
             {
                 vm.Update(message.Source);
             }
         }
     }, location: this.GetType());
     AddEventPath <KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole,
                                             action: message => {
         if (_dicById.ContainsKey(message.Source.GetId()))
         {
             _dicById.Remove(message.Source.GetId());
             OnPropertyChanged(nameof(AllKernelOutputVms));
             OnPropertyChanged(nameof(PleaseSelectVms));
         }
     }, location: this.GetType());
     Init();
 }
Esempio n. 12
0
 public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm)
 {
     if (WpfUtil.IsInDesignMode)
     {
         return;
     }
     this.Vm          = new KernelOutputPageViewModel();
     this.DataContext = this.Vm;
     InitializeComponent();
     this.OnLoaded(window => {
         window.BuildEventPath <KernelOutputKeywordLoadedEvent>("刷新Vm内存", LogEnum.None, this.GetType(), PathPriority.BelowNormal, message => {
             this.Vm.CurrentKernelOutputVm?.OnPropertyChanged(nameof(KernelOutputViewModel.KernelOutputKeywords));
         });
     });
     if (selectedKernelOutputVm != null)
     {
         Vm.CurrentKernelOutputVm = selectedKernelOutputVm;
     }
 }
Esempio n. 13
0
 private KernelOutputViewModels()
 {
     if (WpfUtil.IsInDesignMode)
     {
         return;
     }
     VirtualRoot.BuildEventPath <ServerContextReInitedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                                                             path: message => {
         _dicById.Clear();
         Init();
     });
     VirtualRoot.BuildEventPath <ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                                                             path: message => {
         AllPropertyChanged();
     });
     BuildEventPath <KernelOutputAddedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                                             path: message => {
         var vm = new KernelOutputViewModel(message.Source);
         _dicById.Add(message.Source.GetId(), vm);
         OnPropertyChanged(nameof(AllKernelOutputVms));
         OnPropertyChanged(nameof(PleaseSelectVms));
     });
     BuildEventPath <KernelOutputUpdatedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                                               path: message => {
         if (_dicById.TryGetValue(message.Source.GetId(), out KernelOutputViewModel vm))
         {
             if (vm != null)
             {
                 vm.Update(message.Source);
             }
         }
     });
     BuildEventPath <KernelOutputRemovedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                                               path: message => {
         if (_dicById.ContainsKey(message.Source.GetId()))
         {
             _dicById.Remove(message.Source.GetId());
             OnPropertyChanged(nameof(AllKernelOutputVms));
             OnPropertyChanged(nameof(PleaseSelectVms));
         }
     });
     Init();
 }
Esempio n. 14
0
 public KernelOutputEditCommand(FormType formType, KernelOutputViewModel source)
 {
     this.FormType = formType;
     this.Source   = source;
 }
Esempio n. 15
0
 public ShowKernelOutputPageCommand(KernelOutputViewModel selectedKernelOutputVm)
 {
     this.SelectedKernelOutputVm = selectedKernelOutputVm;
 }
 public bool TryGetKernelOutputVm(Guid id, out KernelOutputViewModel kernelOutputVm)
 {
     return(_dicById.TryGetValue(id, out kernelOutputVm));
 }
Esempio n. 17
0
 public KernelOutputEdit(KernelOutputViewModel vm)
 {
     this.DataContext = vm;
     InitializeComponent();
     ResourceDictionarySet.Instance.FillResourceDic(this, this.Resources);
 }
Esempio n. 18
0
 public KernelOutputEdit(KernelOutputViewModel vm)
 {
     this.DataContext = vm;
     InitializeComponent();
 }