/// <summary>
        /// 初始化流程菜单菜单项
        /// </summary>
        /// <param name="menu"></param>
        private void InitProcessPopupMenu(DeluxeMenu menu)
        {
            menu.StaticDisplayLevels = 0;

            menu.Items.Add(new MenuItem()
            {
                Text = "编辑流程属性", NavigateUrl = string.Format("javascript:$find('{0}').editProcessProperties()", this.ClientID)
            });
            menu.Items.Add(new MenuItem()
            {
                Text = "增加活动", NavigateUrl = string.Format("javascript:$find('{0}').addActivity()", this.ClientID)
            });

            if (this.ShowMainStream == false)
            {
                menu.Items.Add(new MenuItem()
                {
                    Text = "自动流转", NavigateUrl = string.Format("javascript:$find('{0}').autoMoveTo()", this.ClientID)
                });
            }

            menu.Items.Add(new MenuItem()
            {
                Text = "重新计算候选人", NavigateUrl = string.Format("javascript:$find('{0}').generateCurrentProcessCandidates()", this.ClientID)
            });
        }
Ejemplo n.º 2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IDesignerHost service   = (IDesignerHost)context.GetService(typeof(IDesignerHost));
            DeluxeMenu    component = (DeluxeMenu)context.Instance;

            ((MenuItemsDesigner)service.GetDesigner(component)).InvokeMenuItemCollectionEditor();
            return(value);
        }
Ejemplo n.º 3
0
		private string GetMenuDesignHTML(DeluxeMenu menu)
        {
            StringBuilder strB = new StringBuilder();
            strB.Append("<Table>");
            strB.Append(this.GetMenuItemsDesignHTML(menu.Items, 0));
            strB.Append("</Table>");

            return strB.ToString();
        }
Ejemplo n.º 4
0
        private string GetMenuDesignHTML(DeluxeMenu menu)
        {
            StringBuilder strB = new StringBuilder();

            strB.Append("<Table>");
            strB.Append(this.GetMenuItemsDesignHTML(menu.Items, 0));
            strB.Append("</Table>");

            return(strB.ToString());
        }
        /// <summary>
        /// 初始化线的菜单
        /// </summary>
        /// <param name="menu"></param>
        private void InitTransitionPopupMenu(DeluxeMenu menu)
        {
            menu.StaticDisplayLevels = 0;

            menu.Items.Add(new MenuItem()
            {
                Text = "编辑连线属性", NavigateUrl = string.Format("javascript:$find('{0}').editTransitionProperties()", this.ClientID)
            });
            menu.Items.Add(new MenuItem()
            {
                Text = "删除连线", NavigateUrl = string.Format("javascript:$find('{0}').deleteTransition()", this.ClientID)
            });
        }
Ejemplo n.º 6
0
        public MenuItemsEditorForm(DeluxeMenu oMenu)
        {
            InitializeComponent();
            this._firstActivate = true;
            _navBar             = oMenu;
            Items = oMenu.Items;

            // add pre-existing nodes
            foreach (MCS.Web.WebControls.MenuItem oRoot in Items)
            {
                TreeNode oRootNode = new TreeNode(oRoot.Text);
                LoadNodes(oRoot, oRootNode);
                _treeView.Nodes.Add(oRootNode);
            }
            this.propertyGrid1.Site = new FormPropertyGridSite(oMenu.Site, this.propertyGrid1);
            _treeView.HideSelection = false;
        }
Ejemplo n.º 7
0
	  public MenuItemsEditorForm(DeluxeMenu oMenu)
    {
      InitializeComponent();
      this._firstActivate = true;
      _navBar = oMenu;
      Items = oMenu.Items;

      // add pre-existing nodes
      foreach (MCS.Web.WebControls.MenuItem oRoot in Items)
      {
        TreeNode oRootNode = new TreeNode(oRoot.Text);
        LoadNodes(oRoot, oRootNode);
        _treeView.Nodes.Add(oRootNode);
      }
      this.propertyGrid1.Site = new FormPropertyGridSite(oMenu.Site, this.propertyGrid1);
      _treeView.HideSelection = false;
    }
Ejemplo n.º 8
0
        /// <summary>
        /// 展示设计时状态
        /// </summary>
        /// <param name="menu"></param>
        /// <returns></returns>
        ///<remarks></remarks>
        public string GetMenuDesignHTML(DeluxeMenu menu)
        {
            StringBuilder strB = new StringBuilder();

            if (menu.items.Count == 0)
            {
                strB.Append("<div>");
                strB.Append(MCS.Web.WebControls.Properties.Resources.EnptyMenuDesignTimeHtml);
                strB.Append("</div>");
            }
            else
            {
                strB.Append("<Table>");
                strB.Append(this.GetMenuItemsDesignHTML(menu.Items, 0));
                strB.Append("</Table>");
            }
            return(strB.ToString());
        }
Ejemplo n.º 9
0
        public override string GetDesignTimeHtml()
        {
            try
            {
                DeluxeMenu m = (DeluxeMenu)this.ViewControl;

                if (m.Items.Count == 0)
                {
                    return(this.GetEmptyDesignTimeHtml());
                }
                else
                {
                    return(this.GetMenuDesignHTML(m));
                }
            }
            catch (Exception ex)
            {
                return(GetErrorDesignTimeHtml(ex));
            }
            //return string.Format("<span>{0}</span>", menu.ID);
        }
Ejemplo n.º 10
0
        private bool EditMenuItemsChangeCallback(object context)
        {
            bool                    changed       = false;
            DeluxeMenu              oControl      = (DeluxeMenu)Component;
            IServiceProvider        site          = oControl.Site;
            IComponentChangeService changeService = null;

            try
            {
                MenuItemsEditorForm oEditorForm = new MenuItemsEditorForm(oControl);
                if (oEditorForm.ShowDialog() == DialogResult.OK)
                {
                    changed = true;
                }
            }
            finally
            {
                if (changed && changeService != null)
                {
                    changeService.OnComponentChanged(oControl, null, null, null);
                }
            }
            return(changed);
        }
Ejemplo n.º 11
0
        public override bool EditComponent(ITypeDescriptorContext context, object component, IWin32Window owner)
        {
            DeluxeMenu              oControl      = (DeluxeMenu)component;
            IServiceProvider        site          = oControl.Site;
            IComponentChangeService changeService = null;

            DesignerTransaction transaction = null;
            bool changed = false;

            try
            {
                if (site != null)
                {
                    IDesignerHost designerHost = (IDesignerHost)site.GetService(typeof(IDesignerHost));
                    transaction = designerHost.CreateTransaction("BuildMenu");

                    changeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService));
                    if (changeService != null)
                    {
                        try
                        {
                            changeService.OnComponentChanging(component, null);
                        }
                        catch (CheckoutException ex)
                        {
                            if (ex == CheckoutException.Canceled)
                            {
                                return(false);
                            }
                            throw ex;
                        }
                    }
                }

                try
                {
                    MenuItemsEditorForm oEditorForm = new MenuItemsEditorForm(oControl);
                    if (oEditorForm.ShowDialog(owner) == DialogResult.OK)
                    {
                        changed = true;
                    }
                }
                finally
                {
                    if (changed && changeService != null)
                    {
                        changeService.OnComponentChanged(oControl, null, null, null);
                    }
                }
            }
            finally
            {
                if (transaction != null)
                {
                    if (changed)
                    {
                        transaction.Commit();
                    }
                    else
                    {
                        transaction.Cancel();
                    }
                }
            }

            return(changed);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 展示设计时状态
        /// </summary>
        /// <param name="menu"></param>
        /// <returns></returns>
        ///<remarks></remarks>
		public string GetMenuDesignHTML(DeluxeMenu menu)
        {
            StringBuilder strB = new StringBuilder();
            if (menu.items.Count == 0)
            {
                strB.Append("<div>");
                strB.Append(MCS.Web.WebControls.Properties.Resources.EnptyMenuDesignTimeHtml);
                strB.Append("</div>");
            }
            else
            {
                strB.Append("<Table>");
                strB.Append(this.GetMenuItemsDesignHTML(menu.Items, 0));
                strB.Append("</Table>");
            }
            return strB.ToString();
        }