public ChatWindowViewModel(ChatWindowViewModelSettings settings, List <TranslationEngine> translationEngines, List <ChatMsgType> allChatCodes, HotKeyManager hotKeyManager)
        {
            this._AsyncPropertyChanged    = new AsyncEvent <AsyncPropertyChangedEventArgs>(this.EventErrorHandler, "ChatWindowViewModel \n AsyncPropertyChanged");
            this._RequestChatClear        = new AsyncEvent <TatruEventArgs>(this.EventErrorHandler, "ChatWindowViewModel \n RequsetChatClear");
            ShowChatWindowCommand         = new TataruUICommand(ShowChatWindow);
            RestChatWindowPositionCommand = new TataruUICommand(ResetChatWindowPosition);

            _IsWindowVisible = true;

            Name   = settings.Name;
            _WinId = settings.WinId;

            ChatFontSize    = settings.ChatFontSize;
            LineBreakHeight = settings.LineBreakHeight;
            SpacingCount    = settings.SpacingCount;

            IsAlwaysOnTop  = settings.IsAlwaysOnTop;
            IsClickThrough = settings.IsClickThrough;
            IsAutoHide     = settings.IsAutoHide;

            AutoHideTimeout = settings.AutoHideTimeout;

            IsHiddenByUser = false;

            BackGroundColor = settings.BackGroundColor;

            TranslationEngines = new CollectionView(translationEngines);

            var tmpEngine = translationEngines.FirstOrDefault(x => x.EngineName == settings.TranslationEngineName);

            TranslationEngines.MoveCurrentToFirst();
            if (tmpEngine != null)
            {
                if (TranslationEngines.Contains(tmpEngine))
                {
                    TranslationEngines.MoveCurrentTo(tmpEngine);
                }
                else
                {
                    TranslationEngines.MoveCurrentToFirst();
                }
            }

            OnTranslationEngineChange(this, null);

            TrySetLangugue(_TranslateFromLanguagues, settings.FromLanguague);
            TrySetLangugue(_TranslateToLanguagues, settings.ToLanguague);

            ChatWindowRectangle = settings.ChatWindowRectangle;

            ChatCodes = LoadChatCodes(settings.ChatCodes, allChatCodes);

            _HotKeyManager = hotKeyManager;

            ShowHideChatKeys     = new HotKeyCombination(settings.ShowHideChatKeys);
            ClickThoughtChatKeys = new HotKeyCombination(settings.ClickThoughtChatKeys);
            ClearChatKeys        = new HotKeyCombination(settings.ClearChatKeys);

            _HotKeyManager.GlobalHotKeyPressed += OnGlobalHotKeyPressed;
        }
        public TataruViewModel(TataruModel tatruModel)
        {
            this._ChatWindowsListChangedAsync = new AsyncEvent <AsyncListChangedEventHandler <ChatWindowViewModel> >(this.EventErrorHandler, "TataruViewModel \n ChatWindowsListChangedAsync");

            ChatWindows  = new AsyncBindingList <ChatWindowViewModel>();
            _TataruModel = tatruModel;

            _TataruUIModel = tatruModel.TataruUIModel;

            TranslationEngines = tatruModel.ChatProcessor.TranslationEngines;
            _AllChatCodes      = tatruModel.ChatProcessor.AllChatCodes;

            SwitchLanguageCommand   = new TataruUICommand(ChangeUILanguageCommand);
            AddNewChatWindowCommand = new TataruUICommand(AddNewChatWindow);
            DeleteChatWindowCommand = new TataruUICommand(DeleteChatWindow);
            ShowChatWindowCommand   = new TataruUICommand(ShowChatWindow);

            ShutDownRequestedCommand = new TataruUICommand(ShutDownRequsted);

            this.PropertyChanged += OnSelectedTabChanged;
        }
        public ChatWindowViewModel()
        {
            this._AsyncPropertyChanged    = new AsyncEvent <AsyncPropertyChangedEventArgs>(this.EventErrorHandler, "ChatWindowViewModel \n AsyncPropertyChanged");
            ShowChatWindowCommand         = new TataruUICommand(ShowChatWindow);
            RestChatWindowPositionCommand = new TataruUICommand(ResetChatWindowPosition);

            Random rnd = new Random(DateTime.UtcNow.Date.Millisecond);

            _WinId = (DateTime.Now.Ticks * 100u) + ((uint)rnd.Next(0, 100));

            Name = "2";

            ChatFontSize        = 1;
            LineBreakHeight     = 1;
            SpacingCount        = 1;
            BackGroundColor     = Color.FromArgb(255, 0, 255, 128);
            ChatWindowRectangle = new System.Drawing.RectangleD(0, 0, 480, 320);

            ChatCodes = new BindingList <ChatCodeViewModel>()
            {
                new ChatCodeViewModel("0039", "System", Colors.Aqua, true),
            };
        }