コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void Init(string id, IHsmExecutionModel executionModel)
 {
     _Id             = id;
     _ExecutionModel = executionModel;
 }
コード例 #4
0
 private void InitHsmRunner()
 {
     _SharedExecutionModel = new MultipleHsmsPerThread();
 }
コード例 #5
0
 private void InitHsmRunner()
 {
     _ThreadPerHsmExecutionModel = new ThreadPerHsm();
     _SharedExecutionModel       = new MultipleHsmsPerThread();
     _ThreadPoolExecutionModel   = new MultipleHsmsPerThreadPool();
 }