public MFPlannerWorkersWindow()
        {
            InitializeComponent();

            DataContext = this;

            MFPlannerManager.WorkersChanged += MFPlannerManager_WorkersChanged;
            MFPlannerManager.ReloadWorkersAsync();
        }
Beispiel #2
0
        public MFPlannerControl()
        {
            try
            {
                // контекстное меню
                ContextMenu         = new ContextMenu();
                ContextMenu.Opened += ContextMenu_Opened;

                var mnu = new MenuItem {
                    Header = "Проект", Tag = MFWorkerActionType.Project
                };
                mnu.Click += mnu_Click;
                ContextMenu.Items.Add(mnu);

                mnu = new MenuItem {
                    Header = "Резервирование проекта", Tag = MFWorkerActionType.ReseveProject
                };
                mnu.Click += mnu_Click;
                ContextMenu.Items.Add(mnu);

                ContextMenu.Items.Add(new Separator());

                mnu = new MenuItem {
                    Header = "Простой", Tag = MFWorkerActionType.Avait
                };
                mnu.Click += mnu_Click;
                ContextMenu.Items.Add(mnu);

                ContextMenu.Items.Add(new Separator());

                mnu = new MenuItem {
                    Header = "Отпуск", Tag = MFWorkerActionType.Holiday
                };
                mnu.Click += mnu_Click;
                ContextMenu.Items.Add(mnu);

                mnu = new MenuItem {
                    Header = "Больничный", Tag = MFWorkerActionType.Hospital
                };
                mnu.Click += mnu_Click;
                ContextMenu.Items.Add(mnu);

                ClipToBounds = true;

                timerUpdateAction.Tick += timerUpdateAction_Tick;

                MFPlannerManager.WorkersChanged += MFPlannerManager_WorkersChanged;
                MFPlannerManager.ActionsChanged += MFPlannerManager_ActionsChanged;

                MFPlannerManager.ReloadWorkersAsync();
            }
            catch (Exception ex)
            {
                LogManager.LogError(unit, "Ошибка инициализации окна планировщика производства", ex);
            }
        }