Пример #1
0
        public MainWindow()
        {
            InitializeComponent();

            #region Hide
            WindowState   = WindowState.Minimized;
            Visibility    = Visibility.Hidden;
            ShowInTaskbar = false;
            #endregion

            #region Events Subscription
            Closing += OnClosing;
            #endregion

            var jsonConfigFile = new JsonConfigFileHandler();
            _taskRepository = new ExecutableTaskRepository(jsonConfigFile);
            _taskHandler    = new TaskHandler(_taskRepository);
            _taskHandler.TasksGlobalStatusChanged += AppStatusChanged;
            _taskHandler.AppWorkingStatusChanged  += AppWorkingStatusChanged;

            _viewModel = new TasksManagerViewModel(_taskRepository);

            var fullPath         = Assembly.GetExecutingAssembly().Location;
            var autostartManager = new AutoStartManager(AppName, fullPath);
            _sysTrayWrapper = new SysTrayWrapper(autostartManager);
            _sysTrayWrapper.LeftCLickOnTrayIconOccured += LeftClickOnTray;
            _sysTrayWrapper.CloseAction += CloseAction;

            _taskHandler.StartAnalysing();
        }
Пример #2
0
 public TaskHandler(ExecutableTaskRepository taskRepository)
 {
     _globalStatus   = TasksGlobalStatusEnum.IsOk;
     _taskRepository = taskRepository;
 }