Beispiel #1
0
        /// <summary>
        /// 显示在指定容器控件中
        /// </summary>
        /// <param name="workitem">WorkItem</param>
        /// <param name="container">容器</param>
        /// <param name="title">标题</param>
        /// <param name="layout">布局类</param>
        public void Build(WorkItem workitem, Control container, string title, UILayout layout)
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(CultureName);

            //根据布局生成界面
            Control control = this.BuildUp(workitem, title, layout);

            container.Controls.Add(control);

            control.Disposed += delegate(object orgsender, System.EventArgs ag)
            {
                DisposeWorkItem(workitem);
            };
        }
Beispiel #2
0
        /// <summary>
        /// 显示在指定场景的Workpace里
        /// </summary>
        /// <param name="workitem">Workitem</param>
        /// <param name="workspace">WorkSpace</param>
        /// <param name="title">标题</param>
        /// <param name="layout">布局类</param>
        public void Build(WorkItem workitem, IWorkspace workspace, string title, UILayout layout)
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(CultureName);

            //根据布局生成界面
            Control control = this.BuildUp(workitem, title, layout);

            SmartPartInfo sp = new SmartPartInfo();

            sp.Title       = title;
            sp.Description = control.Text;

            //显示界面
            workspace.Show(control, sp);

            control.Disposed += delegate(object orgsender, System.EventArgs ag)
            {
                DisposeWorkItem(workitem);
            };
        }