コード例 #1
0
        public override void OnAttached()
        {
            base.OnAttached();

            var settings = Bot.Settings.GetOrAddEntry <BasicPluginSettings>();

            m_floodEntries         = new ObservableCollection <FloodEntry>(settings.FloodEntries);
            m_readOnlyFloodEntries = new ReadOnlyObservableCollection <FloodEntry>(m_floodEntries);

            BotViewModel   viewModel = Bot.GetViewModel();
            LayoutDocument layout    = viewModel.AddDocument(this, () => new ChatView());

            layout.Title    = "Chat";
            layout.CanClose = false;
            View.Dispatcher.Invoke(new Action(() => m_channelNameConverter = View.Resources["ChannelNameConverter"] as ChannelNameConverter));
        }
コード例 #2
0
        public ChatViewModel(Bot bot)
            : base(bot)
        {
            AvailableChannels = new[]
            {
                ChatActivableChannelsEnum.CHANNEL_GLOBAL,
                ChatActivableChannelsEnum.CHANNEL_TEAM,
                ChatActivableChannelsEnum.CHANNEL_GUILD,
                ChatActivableChannelsEnum.CHANNEL_ALIGN,
                ChatActivableChannelsEnum.CHANNEL_PARTY,
                ChatActivableChannelsEnum.CHANNEL_SALES,
                ChatActivableChannelsEnum.CHANNEL_SEEK,
                ChatActivableChannelsEnum.CHANNEL_NOOB,
                ChatActivableChannelsEnum.CHANNEL_ARENA,
                ChatActivableChannelsEnum.PSEUDO_CHANNEL_PRIVATE,
            };



            m_floodEntries         = new ObservableCollection <FloodEntry>();
            m_readOnlyFloodEntries = new ReadOnlyObservableCollection <FloodEntry>(m_floodEntries);

            m_channelNameConverter = new ChannelNameConverter();
        }