public Menu(Dictionary<string, Action> entries, Program.State state) { this.state = state; if(entries.Count > 9) { Dictionary<string, Action> newEntries = new Dictionary<string, Action>(); Dictionary<string, Action> childEntries = new Dictionary<string, Action>(); int i = 0; foreach(KeyValuePair<string, Action> pair in entries) { if(i < 9) { i++; newEntries.Add(pair.Key, pair.Value); } else { i++; childEntries.Add(pair.Key, pair.Value); } } childMenu = new Menu(childEntries, Program.State.ChildMenu); childMenu.isChild = true; childMenu.parent = this; this.entries = newEntries; } else this.entries = entries; }
public StatusBarViewModel() { _stateInfo.Add(new StateInfo { ImagePath = "../Recources/Images/ok.png", Description = Resources.ProgramStateDescription_Good }); _stateInfo.Add(new StateInfo { ImagePath = "../Recources/Images/loading.png", Description = Resources.ProgramStateDescription_Busy }); _stateInfo.Add(new StateInfo { ImagePath = "../Recources/Images/error.png", Description = Resources.ProgramStateDescription_Error }); _currentState = StaticLoader.Application.State; StaticLoader.Mediator.Register(MediatorMessages.NewInfoMsg, (Action<string>) this.SetInfoMessage); StaticLoader.Mediator.Register(MediatorMessages.SetProgramState, (Action<Program.State>) this.SetProgramState); StaticLoader.Mediator.Register(MediatorMessages.ChangeZoom, (Action<int>) this.ChangeImageZoom); }
public StatusBarViewModel() { _stateInfo.Add(new StateInfo { ImagePath = "../Recources/Images/ok.png", Description = Resources.ProgramStateDescription_Good }); _stateInfo.Add(new StateInfo { ImagePath = "../Recources/Images/loading.png", Description = Resources.ProgramStateDescription_Busy }); _stateInfo.Add(new StateInfo { ImagePath = "../Recources/Images/error.png", Description = Resources.ProgramStateDescription_Error }); _currentState = StaticLoader.Application.State; StaticLoader.Mediator.Register(MediatorMessages.NewInfoMsg, (Action <string>) this.SetInfoMessage); StaticLoader.Mediator.Register(MediatorMessages.SetProgramState, (Action <Program.State>) this.SetProgramState); StaticLoader.Mediator.Register(MediatorMessages.ChangeZoom, (Action <int>) this.ChangeImageZoom); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.MainWindow = new MainWindow(); this.MainWindow.Show(); LogViewer.Owner = this.MainWindow; State = Program.State.Good; }
protected Menu(Program.State state) { this.state = state; }
public void SetProgramState(Program.State state) { this.CurrentState = state; }