示例#1
0
 public BaseViewModel(bool initializeNotifier)
 {
     if (initializeNotifier)
     {
         NotifierContext = NotifierGenerator.MakeContext <IClientNotifierContext>();
         var notifier = (Notifier)ClientModel.Notifier;
         notifier.Add(NotifierContext);
     }
 }
示例#2
0
        protected override void Initialize()
        {
            downloadingFiles             = new List <string>();
            clientEvents                 = NotifierGenerator.MakeEvents <IClientEvents>();
            clientEvents.ReceiveMessage += OnReceiveMessage;

            commands = new List <ClientPluginCommand>
            {
                new ClientMakeScreenCommand(),
                new ClientScreenDoneCommand()
            };
        }
示例#3
0
        public BaseViewModel(BaseViewModel parent, bool initializeNotifier)
        {
            if (parent != null)
            {
                Dispatcher = parent.Dispatcher;
            }

            if (initializeNotifier)
            {
                NotifierContext = NotifierGenerator.MakeContext <IClientNotifierContext>();
                ClientModel.Notifier.Add(NotifierContext);
            }
        }
示例#4
0
        public BaseViewModel(BaseViewModel parent, bool initializeNotifier)
        {
            if (parent != null)
            {
                Dispatcher = parent.Dispatcher;
            }

            if (initializeNotifier)
            {
                Events = NotifierGenerator.MakeEvents <IClientEvents>();
                ClientModel.Notifier.Add(Events);
            }
        }
示例#5
0
        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));
        }