public ScanForm() { InitializeComponent(); lblState.Text = "Ожидание."; CreateComputer(); presenter = new ScanPresenter(this); currentComputer.onComputerSelect += (computer) => Process.Start("control.exe", "System"); }
/// <summary> /// Execute scan command /// </summary> /// <param name="entity"></param> /// <returns></returns> public static ICommandResult Scan(IEntity entity) { if (entity.GetType() == typeof(Scan)) { Scan scanData = (Scan)entity; IScanPresenter presenter = ServiceLocator.GetObject <IScanPresenter>(ServiceLocator.GetObject <IScanView>(scanData)); presenter.Scan(null, scanData); return(presenter); } throw new ArgumentOutOfRangeException("entity", string.Format("{0} Entity is not supported.", entity.GetType())); }