public ChatWindow(TataruModel tataruModel, ChatWindowViewModel chatWindowViewModel)
        {
            InitializeComponent();

            try
            {
                _TataruModel         = tataruModel;
                _ChatWindowViewModel = chatWindowViewModel;

                this.DataContext = _ChatWindowViewModel;

                _WindowResizer = new WindowResizer(this);

                this.ShowInTaskbar = false;

                ChatRtb.AcceptsTab = true;

                ChatRtb.BorderThickness = new Thickness(0);

                ChatRtb.Document.Blocks.Clear();

                ChatRtb.IsUndoEnabled = false;

                _TextArrivedTime = DateTime.UtcNow;

                _KeepWorking = true;
                _AutoHidden  = false;
            }
            catch (Exception e)
            {
                Logger.WriteLog(e);
            }
        }
Exemple #2
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                Logger.WriteLog("TataruHelper v" + Convert.ToString(System.Reflection.Assembly.GetEntryAssembly().GetName().Version));
            }
            catch (Exception) { }

            try
            {
                try
                {
                    _TataruModel = new TataruModel(this);

                    await _TataruModel.InitializeComponent();

                    _TataruUIModel = _TataruModel.TataruUIModel;

                    InitTataruModel();
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(ex);
                }

                _TataruModel.AsyncLoadSettings().Forget();

                _TataruModel.FFMemoryReader.AddExclusionWindowHandler((new WindowInteropHelper(this).Handle));

                this.DataContext = _TataruModel.TataruViewModel;

                _TataruModel.TataruViewModel.ShutdownRequested += OnShutDownRequsted;

                _OptimizeFootprint = new OptimizeFootprint();
                _OptimizeFootprint.Start();

                _WinMessagesHandler = new WinMessagesHandler(this);
                _WinMessagesHandler.ShowFirstInstance += OnShowFirstInstance;

                _Updater.UpdatingStateChanged += OnUpdaterEvent;

#if DEBUG
#else
                Task.Run(() =>
                {
                    _Updater.CheckAndInstallUpdates(CmdArgsStatus.PreRelease);

                    _UpdaterTimer           = new Timer(TimeSpan.FromMinutes(30).TotalMilliseconds);
                    _UpdaterTimer.Elapsed  += async(senderr, ee) => await UpdateTimerHandler();
                    _UpdaterTimer.AutoReset = true;
                    _UpdaterTimer.Start();
                }).Forget();
#endif
            }
            catch (Exception ex)
            {
                Logger.WriteLog(ex);
            }
        }
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                try
                {
                    _TataruModel = new TataruModel();
                    await _TataruModel.InitializeComponent();

                    _TataruUIModel = _TataruModel.TataruUIModel;

                    InitTataruModel();
                }
                catch (Exception ex)
                {
                    Logger.WriteLog(ex);
                }

                _TataruModel.AsyncLoadSettings().Forget();

                _TataruModel.FFMemoryReader.AddExclusionWindowHandler((new WindowInteropHelper(this).Handle));

                try
                {
                    Logger.WriteLog("TataruHelper v" + Convert.ToString(System.Reflection.Assembly.GetEntryAssembly().GetName().Version));
                }
                catch (Exception) { }

                _Updater.StartUpdate();


                this.DataContext = _TataruModel.TataruViewModel;

                _TataruModel.TataruViewModel.ShutdownRequested += OnShutDownRequsted;

                _OptimizeFootprint = new OptimizeFootprint();
                _OptimizeFootprint.Start();

                _WinMessagesHandler = new WinMessagesHandler(this);
                _WinMessagesHandler.ShowFirstInstance += OnShowFirstInstance;
            }
            catch (Exception ex)
            {
                Logger.WriteLog(ex);
            }
        }