private IHsmExecutionModel GetModelForSender(object sender, out string requestedThreadingModel) { IHsmExecutionModel executionModel = null; Control button = (Control)sender; requestedThreadingModel = (string)button.Tag; switch (requestedThreadingModel) { case "Shared": executionModel = _SharedExecutionModel; break; case "Own": executionModel = _ThreadPerHsmExecutionModel; break; case "Pool": executionModel = _ThreadPoolExecutionModel; break; default: throw new FormatException("Unknown Requested Threading Model: " + requestedThreadingModel); } return(executionModel); }
private void buttonCreateWatch_Click(object sender, System.EventArgs e) { string requestedThreadingModel; IHsmExecutionModel executionModel = GetModelForSender(sender, out requestedThreadingModel); string id = "Watch " + tabControlWatches.TabCount; TabPage tabPage = new TabPage(id + "@" + requestedThreadingModel); tabControlWatches.TabPages.Add(tabPage); WatchUserControl watchControl = new WatchUserControl(); watchControl.Init(id, executionModel); watchControl.Dock = DockStyle.Fill; tabPage.Controls.Add(watchControl); }
public void Init(string id, IHsmExecutionModel executionModel) { _Id = id; _ExecutionModel = executionModel; }
private void InitHsmRunner() { _SharedExecutionModel = new MultipleHsmsPerThread(); }
private void InitHsmRunner() { _ThreadPerHsmExecutionModel = new ThreadPerHsm(); _SharedExecutionModel = new MultipleHsmsPerThread(); _ThreadPoolExecutionModel = new MultipleHsmsPerThreadPool(); }