/// <summary> /// Initializes a new instance of the <see cref="PluginContext"/> class. /// Is marked as internal so external clients cannot instantiate. /// </summary> /// <param name="client">The client.</param> /// <param name="console">The console.</param> /// <param name="authorizer">The authorizer.</param> /// <param name="chatrooms">The chatrooms.</param> /// <param name="listener">The listener.</param> /// <param name="botSettings">The bot settings.</param> /// <param name="pluginHandler">The plugin handler.</param> /// <param name="dispatcher">The system dispatcher.</param> /// <param name="packet">The current packet to be processed.</param> /// <param name="chatHelper">The chat helper.</param> public PluginContext(Client client, IConsole console, IAuthorization authorizer, IChatRoomContainer chatrooms, IListener listener, IBotSettings botSettings, IPluginHandler pluginHandler, IDispatcher dispatcher, EventPacket packet, IChatHelper chatHelper) { this.Client = client; this.Console = console; this.Authorizer = authorizer; this.ChatRooms = chatrooms; this.Listener = listener; this.BotSettings = botSettings; this.Plugins = pluginHandler; this.Dispatcher = dispatcher; this.ThisRoom = chatHelper; }
/// <summary> /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class. /// </summary> /// <param name="bot">The bot.</param> /// <param name="settings">Bot settings.</param> /// <param name="dialogs">Dialog service.</param> /// <param name="messageBox">MessageBox service.</param> /// <param name="chatrooms">The chatroom container.</param> /// <param name="chatRoomViewModels">Chatroom view models.</param> /// <param name="dispatcher">The dispatcher.</param> public MainWindowViewModel(Bot bot, IBotSettings settings, IModalDialogService dialogs, IMessageBoxService messageBox, IChatRoomContainer chatrooms, IChatViewModelFactory chatRoomViewModels, IDispatcherHelper dispatcher) { this.bot = bot; this.settings = settings; this.dialogs = dialogs; this.messageBox = messageBox; this.chatRoomViewModels = chatRoomViewModels; this.dispatcher = dispatcher; // set up commands LoadedCommand = new RelayCommand(() => OnLoaded()); // subscribe to events MessengerInstance.Register<LoginSettingsRequested>(this, OnSettingsRequested); chatrooms.CollectionChanged += OnChatRoomsChanged; }