public AppViewModel_Default() { _model = new ServerModel(); _model.PropertyChanged += _model_PropertyChanged; _model.LoadSetting(); foreach (var devCashier in _model.DeviceCashiers) { devCashier.Cashier.PropertyChanged += Cashier_PropertyChanged; } if (_model.Listener != null) { _model.Listener.PropertyChanged += Listener_PropertyChanged; _mainTask = _model.Start(); } }
public MainViewModel() { BadFilterReportModel.Start(); FactionsEngine.Start(FiltersEvent); finishInit = FiltersEvent.Start(); // добавляйте ещё через Task.WhenAll ServerModel = new ServerModel(ServerEvents); ServerModel.Start(); GameView = new GameViewModel(GameModel, FiltersEvent); NewsViewModel = new NewsViewModel(GameView); HomeViewModel = new HomeViewModel(GameView); ItemsViewModel = new ItemsViewModel(GameView); AlertsViewModel = new AlertsViewModel(GameView); ActivateHomeCommand = new RelayCommand(() => CurrentContent = HomeViewModel); ActivateNewsCommand = new RelayCommand(() => CurrentContent = NewsViewModel); ActivateItemsCommand = new RelayCommand(() => CurrentContent = ItemsViewModel); ActivateAlertsCommand = new RelayCommand(() => CurrentContent = AlertsViewModel); CurrentContent = HomeViewModel; }
public MainPresenter(IMainForm view) { _view = view; _model = new ServerModel(); _model.PropertyChanged += _model_PropertyChanged; _model.LoadSetting(); foreach (var cashier in _model.Сashiers) { cashier.PropertyChanged += Cashier_PropertyChanged; } if (_model.Listener != null) { _model.Listener.PropertyChanged += Listener_PropertyChanged; _mainTask = _model.Start(); _view.ServerModel = _model;//DEBUG } }
public AppViewModel() { _logger = new Log("Server.Main"); _model = new ServerModel(); _model.PropertyChanged += _model_PropertyChanged; _model.LoadSetting(); foreach (var devCashier in _model.DeviceCashiers) { devCashier.Cashier.PropertyChanged += Cashier_PropertyChanged; devCashier.PropertyChanged += DevCashierOnPropertyChanged; } if (_model.Listener != null) { _model.Listener.PropertyChanged += Listener_PropertyChanged; _mainTask = _model.Start(); } _model.SoundQueue.PropertyChanged += SoundQueue_PropertyChanged; _model.SoundQueue.StartQueue(); var queueMain = _model.QueuePriorities.FirstOrDefault(q => q.Name == "Main"); if (queueMain != null) { queueMain.PropertyChanged += QueueMain_PropertyChanged; } _model.LoadStates(); //ЗАГРУЗКА НАСТРОЕК ТАБЛО HeaderBackgroundColor = new SolidColorBrush(Colors.DarkRed); HeaderFontColor = new SolidColorBrush(Colors.Black); ColorListRows = new SolidColorBrush(Colors.Azure); ColorListBackground = new SolidColorBrush(Colors.CadetBlue); ListFontColor = new SolidColorBrush(Colors.Black); CurrentFontCash = new FontSetting { FontHeader = null, FontRow = new Font(System.Drawing.FontFamily.GenericMonospace, 10), PaddingHeader = 0, PaddingRow = 0 }; CurrentFont8X2 = new FontSetting { FontHeader = new Font(System.Drawing.FontFamily.GenericMonospace, 10), FontRow = new Font(System.Drawing.FontFamily.GenericMonospace, 10), PaddingHeader = 0, PaddingRow = 0 }; CurrentFont4X4 = new FontSetting { FontHeader = new Font(System.Drawing.FontFamily.GenericMonospace, 10), FontRow = new Font(System.Drawing.FontFamily.GenericMonospace, 10), PaddingHeader = 0, PaddingRow = 0 }; var settingUi = LoadSettingUi(); ApplySetting(settingUi); //DEBUG------------- //TimerAutoTest.Elapsed += TimerAutoTest_Elapsed; //TimerAutoTest.Start(); }
static void Main(string[] args) { ServerModel server = new ServerModel(); server.Start(); }