Esempio n. 1
0
        protected override void InitializeCommands()
        {
            SetScopeCommand = new PresenterCommand
            {
                CanExecuteDelegate = s => true,
                ExecuteDelegate = s =>
                    {
                        string scope = (string)s;
                        PnrpScope newScope = PnrpScope.All;

                        switch (scope.ToUpper())
                        {
                            case "ALL":
                                newScope = PnrpScope.All;
                                break;
                            case "GLOBAL":
                                newScope = PnrpScope.Global;
                                break;
                            case "LINKLOCAL":
                                newScope = PnrpScope.LinkLocal;
                                break;
                        }

                        _pnrpService.CurrentScope = newScope;                  
                    }
            };
        }
Esempio n. 2
0
        protected override void InitializeCommands()
        {
            SetScopeCommand = new PresenterCommand
            {
                CanExecuteDelegate = s => true,
                ExecuteDelegate    = s =>
                {
                    string    scope    = (string)s;
                    PnrpScope newScope = PnrpScope.All;

                    switch (scope.ToUpper())
                    {
                    case "ALL":
                        newScope = PnrpScope.All;
                        break;

                    case "GLOBAL":
                        newScope = PnrpScope.Global;
                        break;

                    case "LINKLOCAL":
                        newScope = PnrpScope.LinkLocal;
                        break;
                    }

                    _pnrpService.CurrentScope = newScope;
                }
            };
        }
Esempio n. 3
0
        protected override void InitializeCommands()
        {
            SendCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return(_intelClient.IsConnected); }),
                ExecuteDelegate    = (code => { SendIntel(); })
            };

            LoadImageCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return(true); }),
                ExecuteDelegate    = (code => { LoadImage(); })
            };
        }
Esempio n. 4
0
        protected override void InitializeCommands()
        {
            SendCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return  _intelClient.IsConnected; }),
                ExecuteDelegate = (code => {SendIntel();})
            };

            LoadImageCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return true; }),
                ExecuteDelegate = (code => { LoadImage(); })
            };
        }
Esempio n. 5
0
        protected override void InitializeCommands()
        {
            this.StartCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (x => { return(!this.IsOpen && !string.IsNullOrEmpty(this.HostClassifier)); }),
                ExecuteDelegate    = (x => { StartService(x as string); })
            };

            this.StopCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (x => { return(this.IsOpen); }),
                ExecuteDelegate    = (x => { StopService(); })
            };
        }
 protected override void InitializeCommands()
 {
     this.DeleteRegistrationCommand = new PresenterCommand
     {
         CanExecuteDelegate = code => true,
         ExecuteDelegate = code =>
         {
             PeerNameRegistration reg = code as PeerNameRegistration;
             if (reg != null)
             {
                 _service.DeleteRegistration(reg);
             }
         }
     };
 }
 protected override void InitializeCommands()
 {
     this.DeleteRegistrationCommand = new PresenterCommand
     {
         CanExecuteDelegate = code => true,
         ExecuteDelegate    = code =>
         {
             PeerNameRegistration reg = code as PeerNameRegistration;
             if (reg != null)
             {
                 _service.DeleteRegistration(reg);
             }
         }
     };
 }
Esempio n. 8
0
        protected override void InitializeCommands()
        {
            this.StartCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return(!this.IsConnected); }),
                ExecuteDelegate    = (code => { _client.Start(this.HostClassifier); })
            };

            this.StopCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return(this.IsConnected); }),
                ExecuteDelegate    = (code => { /*_client.Leave(this.Agent); */ _client.Stop(); })
            };

            this.OpenImageCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return(true); }),
                ExecuteDelegate    = (code => { OpenImage(); })
            };
        }
Esempio n. 9
0
        protected override void InitializeCommands()
        {
            this.StartCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (x => { return (!this.IsOpen && !string.IsNullOrEmpty(this.HostClassifier)); }),
                ExecuteDelegate = (x => { StartService(x as string); })
            };

            this.StopCommand  = new PresenterCommand()
            {
                CanExecuteDelegate = (x => { return this.IsOpen; }),
                ExecuteDelegate = (x => { StopService(); })
            };
        }
Esempio n. 10
0
        protected override void InitializeCommands()
        {
            this.StartCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return (!this.IsConnected); }),
                ExecuteDelegate = (code => { _client.Start(this.HostClassifier); })
            };

            this.StopCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return this.IsConnected; }),
                ExecuteDelegate = (code => { /*_client.Leave(this.Agent); */ _client.Stop(); })
            };

            this.OpenImageCommand = new PresenterCommand()
            {
                CanExecuteDelegate = (code => { return true; }),
                ExecuteDelegate = (code => { OpenImage(); })
            };
        }