Ejemplo n.º 1
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            var jobs = Solution.CurrentProject.Items;

            if (persistString == typeof(FormJobs).ToString())
            {
                return(FormJobs.Instance);
            }
            if (persistString == typeof(FormTools).ToString())
            {
                return(FormTools.Instance);
            }
            if (persistString == typeof(FormHalconWindow).ToString())
            {
                if (FormHalconWindowDictionary.Dictionary.Count < _jobCount)
                {
                    FormHalconWindowDictionary.Add(jobs[_haclonWindowCount].Name);
                    toolStripMenuItem_HaclonWindows.DropDownItems.Add(jobs[_jobCount].Name);
                    toolStripMenuItem_HaclonWindows.DropDownItems[_jobCount].Click += toolStripMenuItem_HaclonWindowsDropDownItems_Click;
                }
                _haclonWindowCount++;
                return(FormHalconWindowDictionary.Dictionary[jobs[_haclonWindowCount - 1].Name]);
            }
            //主框架之外的窗体不显示
            return(null);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加job后主界面窗体下拉菜单添加按钮
 /// </summary>
 /// <param name="job">新添加的流程</param>
 /// <param name="showHalconWindow">是不是要显示窗口,程序加载时不用显示,新添加要显示</param>
 private void SolutionHelper_EventAddJob(Job job, bool showHalconWindow)
 {
     FormHalconWindowDictionary.Add(job.Name);
     //todo 这里可能常要改
     if (showHalconWindow)
     {
         FormHalconWindowDictionary.Dictionary[job.Name].ShowForm(dockPanel1);
     }
     toolStripMenuItem_HaclonWindows.DropDownItems.Add(job.Name);
     toolStripMenuItem_HaclonWindows.DropDownItems[_jobCount].Click += toolStripMenuItem_HaclonWindowsDropDownItems_Click;
     _jobCount++;
 }