public BaseViewModel(bool initializeNotifier) { if (initializeNotifier) { NotifierContext = NotifierGenerator.MakeContext <IClientNotifierContext>(); var notifier = (Notifier)ClientModel.Notifier; notifier.Add(NotifierContext); } }
protected override void Initialize() { downloadingFiles = new List <string>(); clientEvents = NotifierGenerator.MakeEvents <IClientEvents>(); clientEvents.ReceiveMessage += OnReceiveMessage; commands = new List <ClientPluginCommand> { new ClientMakeScreenCommand(), new ClientScreenDoneCommand() }; }
public BaseViewModel(BaseViewModel parent, bool initializeNotifier) { if (parent != null) { Dispatcher = parent.Dispatcher; } if (initializeNotifier) { NotifierContext = NotifierGenerator.MakeContext <IClientNotifierContext>(); ClientModel.Notifier.Add(NotifierContext); } }
public BaseViewModel(BaseViewModel parent, bool initializeNotifier) { if (parent != null) { Dispatcher = parent.Dispatcher; } if (initializeNotifier) { Events = NotifierGenerator.MakeEvents <IClientEvents>(); ClientModel.Notifier.Add(Events); } }
public ServerApi(string adminPassword) { _events = NotifierGenerator.MakeEvents <IServerEvents>(); _events.ConnectionClosing += OnConnectionClosing; ServerModel.Notifier.Add(_events); _commands = new Dictionary <long, ICommand>(); AddCommand(new ServerRegisterCommand()); AddCommand(new ServerUnregisterCommand()); AddCommand(new ServerSendRoomMessageCommand()); AddCommand(new ServerCreateRoomCommand()); AddCommand(new ServerDeleteRoomCommand()); AddCommand(new ServerInviteUsersCommand()); AddCommand(new ServerKickUsersCommand()); AddCommand(new ServerExitFromRoomCommand()); AddCommand(new ServerRefreshRoomCommand()); AddCommand(new ServerSetRoomAdminCommand()); AddCommand(new ServerAddFileToRoomCommand()); AddCommand(new ServerRemoveFileFromRoomCommand()); AddCommand(new ServerP2PConnectRequestCommand()); AddCommand(new ServerP2PReadyAcceptCommand()); AddCommand(new ServerPingRequestCommand()); AddCommand(new ServerAdminCommand(adminPassword)); }