public ChatMessageViewModel(IDispatcherService dispatcherService, IDialogService dialogService, IRichTextBoxService chatMessageViewService)
            : base(dispatcherService)
        {
            _dialogService          = dialogService;
            _chatMessageViewService = chatMessageViewService;

            SendMessage = new RelayCommand(() => { SdtdConsole.Instance.SendGlobalMessage(Message); });

            ViewRecord = new RelayCommand(() =>
            {
                Utils.FileHelper.OpenTextFileByNotepad(_dialogService, CommonHelper.GetAppSettings("ChatMessageRecordPath"));
            });

            SdtdConsole.Instance.ChatHook += ChatHook;

            SdtdConsole.Instance.PlayerEnterGame += OnPlayerEnterGame;
            SdtdConsole.Instance.PlayerLeftGame  += OnPlayerLeftGame;
        }
예제 #2
0
        public MainWindowViewModel(IDispatcherService dispatcherService, IRichTextBoxService richTextBoxService, IDialogService dialogService)
            : base(dispatcherService)
        {
            this._outputLogService = richTextBoxService;

            Log.LogRecorded += OnLogRecorded;

            ControlPanelItems = ViewItemManager.Instance.ControlPanelItems;

            FunctionPanelItems = ViewItemManager.Instance.FunctionPanelItems;

            OnReceivedUserInfo(new UserInfo()
            {
                DisplayName = "洛水天依",
                RoleName    = "永久会员",
                ExpiryTime  = DateTime.MinValue,
            });

            // OnReceivedUserInfo(MyClientManager.Instance.UserInfo);
            // Messenger.Default.Register<MyTcpClientMessage>(this, HandeMyTcpClientMessage);
        }