Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     this.MainWindow = new MainWindow();
     this.MainWindow.Show();
     LogViewer.Owner = this.MainWindow;
     State           = Program.State.Good;
 }
Exemplo n.º 5
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     this.MainWindow = new MainWindow();
     this.MainWindow.Show();
     LogViewer.Owner = this.MainWindow;
     State = Program.State.Good;
 }
Exemplo n.º 6
0
 protected Menu(Program.State state)
 {
     this.state = state;
 }
Exemplo n.º 7
0
 public void SetProgramState(Program.State state)
 {
     this.CurrentState = state;
 }