public MainWindowViewModel()
        {
            _container = new UnityContainer();
            _container.RegisterType <ICheckStatusService, TelegramJoinChannel.BLL.Services.CheckStatusService>();
            _container.RegisterType <IChannelsService, TelegramJoinChannel.BLL.Services.ChannelsService>();
            IsAuthorisation     = true;
            _channelsService    = new ChannelsService(_container);
            _checkStatusService = new CheckStatusService(_container);
            InfoChannels        = _channelsService.GetChannelsInfo();
            StatChannels        = _checkStatusService.GetCheckChannelsInfo();
            if (StatChannels.Count != 0)
            {
                LastCheck = StatChannels.Last().CheckDate;
            }

            SetCode        = new RelayCommand(OnSetCode);
            Authenticate   = new RelayCommand(OnAuthenticate);
            CheckMarked    = new RelayCommand(OnCheckMarked);
            CheckAll       = new RelayCommand(OnCheckAll);
            DeleteSelected = new RelayCommand(OnDeleteSelected);
            Search         = new RelayCommand(OnSearch);
            UpdateChannale = new RelayCommand(OnUpdateChannale);

            AddChannel = new RelayCommand(OnAddChannel);

            _files            = new List <string>();
            _updateChannelsBD = new List <ChannelsInfo>();

            _tLChannelFull = new List <TLChannelFull>();
            _tLChannels    = new List <TLChannel>();

            UriList = new ObservableCollection <AddChannels>();

            _numberPhone = "+375293232203";
            Application.Current.MainWindow.Closing += MainWindow_Closing;
        }
Exemplo n.º 2
0
 public CheckStatusController()
 {
     this.checkStatusService = new CheckStatusService();
     this.historyService     = new HistoryService();
     this.reportService      = new ReportService();
 }