コード例 #1
0
        public KhadgarBotViewModel()
        {
            //grab the bot's login info from an xml file so sensitive info isn't publically posted
            var xmlLoginInfo = XDocument.Load(@"..\..\..\Resources\loginInfo.xml");
            var root         = xmlLoginInfo.Descendants("root");
            var botNickname  = root.Descendants("nick").First().Value;
            var botOAuth     = root.Descendants("pass").First().Value;

            ConnectedToTwitch = false;


            Model               = new KhadgarBotModel(botNickname, botOAuth);
            BotAdminViewModel   = new BotAdminViewModel(this);
            CommandLogViewModel = new CommandLogViewModel(this);

            _heroesLibrarian = new HeroesLibrarian("../../../../../Heroes-talents/heroes-talents-master/hero", "HeroesOfTheStormHeroData.db");

            _messageSendTimer          = new Timer(_messageSendTimerInterval);
            _messageSendTimer.Elapsed += MessageSendTimer_Elapsed;
            _whisperSendTimer          = new Timer(_whisperSendTimerInterval);
            _whisperSendTimer.Elapsed += WhisperSendTimer_Elapsed;
            //var result = _heroesLibrarian.GetAbilityAndTalentDataByString("sand blast");
            //var temp = 0;/

            ChangeTabCallback = new DelegateCommand <object>(ExecuteChangeTab);
            ConnectToTwitch   = new Action(ExecuteConnectToTwitch);
            JoinChannel       = new Action <string>(ExecuteJoinChannel);
            LeaveChannel      = new Action <string>(ExecuteLeaveChannel);

            //TestParse();
        }
コード例 #2
0
        public BotAdminViewModel(KhadgarBotViewModel khadgarBotViewModel)
        {
            _khadgarBotViewModel = khadgarBotViewModel;
            _khadgarBotModel     = _khadgarBotViewModel.Model;

            BotName                  = _khadgarBotModel.BotName;
            OAuth                    = _khadgarBotModel.OAuth;
            ChannelName              = _khadgarBotModel.ChannelName;
            HasConnected             = false;
            HasConnectedButNotJoined = false;
            HasJoined                = false;

            ConnectToTwitch = new DelegateCommand(ExecuteConnectToTwitch);
            JoinChannel     = new DelegateCommand(ExecuteJoinChannel);
            LeaveChannel    = new DelegateCommand(ExecuteLeaveChannel);
        }