Ejemplo n.º 1
0
        public ServerViewModel()
        {
            ConsoleService = new ConsoleService();
            ServerService = SimpleIoc.Default.GetInstance<ServerService>();

            Server = new ServerModel();
            ServerService.Initialize(
                ConsoleService,
                Server,
                SimpleIoc.Default.GetInstance<CamerasViewModel>().CamerasModel);

            ServerService.OnClientAddedHandler += delegate(object sender, EventArgs e)
            {
                OnClientAddedEventArgs args = (OnClientAddedEventArgs) e;
                new ClientViewModel(args.Client);
                Messenger.Default.Send(new AddClientMessage(args.Client));
            };

            ServerService.OnClientRemovedHandler += delegate(object sender, EventArgs e)
            {
                OnClientRemovedEventArgs args = (OnClientRemovedEventArgs)e;
                Messenger.Default.Send(new RemoveClientMessage(args.Client));
            };
        }
Ejemplo n.º 2
0
 public void Initialize(IConsoleService consoleService,  ServerModel server, CamerasModel cameras)
 {
     base.Initialize(consoleService, server);
     _cameras = cameras;
 }
Ejemplo n.º 3
0
 public ServerService(IConsoleService consoleService, ServerModel server, CamerasModel cameras)
 {
     Initialize(consoleService, server, cameras);
 }
Ejemplo n.º 4
0
 public void Initialize(IConsoleService consoleService, ServerModel server)
 {
     ConsoleService = consoleService;
     Server = server;
 }