Esempio n. 1
0
        public BotControl(Behaviors.Bot bot)
        {
            Bot = bot;
            InitializeComponent();

            bot.CharactersSelected += OnCharacterSelected;
        }
Esempio n. 2
0
        public BotViewModel GetBotViewModel(Behaviors.Bot bot)
        {
            lock (DocumentPane.Children)
            {
                var document = DocumentPane.Children.FirstOrDefault(x => x.Content is BotControl && (x.Content as BotControl).ViewModel.Bot == bot);

                return(document != null ? (document.Content as BotControl).ViewModel : null);
            }
        }
Esempio n. 3
0
        public void AddChild(Behaviors.Bot bot)
        {
            var child = new MdiChild();

            child.Title   = "Bot";
            child.Content = new BotControl(bot);

            child.Closed += OnChildClosed;

            MdiContainer.Children.Add(child);
        }
Esempio n. 4
0
        public void RemoveChild(Behaviors.Bot bot)
        {
            var childs = MdiContainer.Children.
                         Where(entry => entry.Content is BotControl && (entry.Content as BotControl).Bot == bot).ToArray();

            foreach (var child in childs)
            {
                child.Content = null;
                child.Close();
            }
        }
Esempio n. 5
0
 private void OnCharacterSelected(Behaviors.Bot bot, PlayedCharacter character)
 {
 }
Esempio n. 6
0
 public void HandleIdentificationMessage(Behaviors.Bot bot, IdentificationMessage message)
 {
     Dispatcher.Invoke(new Action(() => CloseChildByLogin(message.login)));
 }
Esempio n. 7
0
 private void OnBotRemoved(BotManager manager, Behaviors.Bot bot)
 {
     // Dispatcher.Invoke(new Action(() => RemoveChild(bot)));
     // note : remove the window only if another bot with the same name is created
 }
Esempio n. 8
0
 private void OnBotAdded(BotManager manager, Behaviors.Bot bot)
 {
     Dispatcher.Invoke(new Action(() => AddChild(bot)));
 }