public AgentViewModel(IAgentDataService agentDataService) { try { this._agentDataService = agentDataService; if (IsInDesignMode) { Title = "Hello MVVM Light (Design Mode)"; } else { Title = "Hello MVVM Light"; LoadMasterData(); } SaveAgentCommand = new RelayCommand(SaveAgent, CanSaveAgent, true); } catch (Exception ex) { while (ex.InnerException != null) { ex = ex.InnerException; } Messenger.Default.Send <NotificationMessage>(new NotificationMessage(ex.Message)); } }
public AgentSummaryRegionController(IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator, IAgentDataService dataService) { if (container == null) { throw new ArgumentNullException("container"); } if (regionManager == null) { throw new ArgumentNullException("regionManager"); } if (eventAggregator == null) { throw new ArgumentNullException("eventAggregator"); } if (dataService == null) { throw new ArgumentNullException("dataService"); } _container = container; _regionManager = regionManager; _eventAggregator = eventAggregator; _dataService = dataService; // Subscribe to the EmployeeSelectedEvent event. // This event is fired whenever the user selects an // employee in the EmployeeListView. _eventAggregator.GetEvent <AgentSelectedEvent>().Subscribe(OnAgentSelected, true); }
public AgentHistoryModule(IAgentDataService agentDataService) { this._agentDataService = agentDataService; Post["/api/agentHistory"] = _ => { var x = this.Request.Body.AsString(); var agentExecution = JsonConvert.DeserializeObject <AgentExecution>(x); if (agentExecution == null) { return(HttpStatusCode.BadRequest); } agentExecution.ExecutionTime = DateTime.UtcNow; _agentDataService.GetInsertedData(agentExecution); return(HttpStatusCode.OK); }; Get["/api/agentHistory"] = p => { var x = _agentDataService.GetExecutedListAgentDetails(); return(Negotiate .WithContentType("aplication/json") .WithModel(x)); }; }
//IDispatcher _dispatcher; public AgentsListViewModel(IAgentDataService dataService, IEventAggregator eventAggregator)//, IDispatcher dispatcher) { _eventAggregator = eventAggregator; _dataService = dataService; AgentsCollection = new ObservableCollection <AgentWrapper>(); //_dispatcher = dispatcher; _eventAggregator.GetEvent <AgentsListUpdated>().Subscribe(OnAgentsListUpdated, true); }
public AgentHistoryModule(IAgentDataService agentDataService) { Post["/api/agentHistory"] = p => { AgentExecution agentExecution = this.Bind <AgentExecution>(); if (agentExecution == null) { return(HttpStatusCode.BadRequest); } agentDataService.GetInsertedData(agentExecution); return(HttpStatusCode.OK); }; Get["/api/agentHistory"] = p => { var x = agentDataService.GetExecutedListAgentDetails(); return(Negotiate .WithContentType("aplication/json") .WithModel(x)); }; }
public AgentsRibbonTabViewModel(IUnityContainer container, IAgentDataService dataService) { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += ExceptionHandler; _container = container; _dataService = dataService; ConnectCommand = new DelegateCommand(ConnectToServer); IsConnectEnabled = true; RefreshAgentsCommand = new DelegateCommand(RefreshAgentsList); InstalledProgramsCommand = new DelegateCommand(ListInstalledPrograms); LockSessionCommand = new DelegateCommand(LockSession); RestartCommand = new DelegateCommand(Restart); ShutDownCommand = new DelegateCommand(ShutDown); CommonCommand = new DelegateCommand(CommonExecute); SelectedComboBoxValue = "Ping"; CommonCommandParameter = "gmail.com"; RemoteControlCommand = new DelegateCommand(RemoteControl); WakeOnLanCommand = new DelegateCommand(WakeOnLan); RunProcessCommand = new DelegateCommand(RunProcess); }
public AgentController(IAgentDataService agentDataService) { _agentDataService = agentDataService; }