fyiReporting.RdlDesign.RdlDesigner.BuildCustomItemsInsertMenu C# (CSharp) 메소드

BuildCustomItemsInsertMenu() 개인적인 메소드

private BuildCustomItemsInsertMenu ( ToolStripDropDownItem menuItem ) : void
menuItem System.Windows.Forms.ToolStripDropDownItem
리턴 void
        private void BuildCustomItemsInsertMenu(ToolStripDropDownItem menuItem)
        {
            try
            {
                var sa = RdlEngineConfig.GetCustomReportTypes();
                if (sa == null || sa.Length == 0)
                    return;

                var separator = menuItem.DropDownItems["CustomSeparator"];

                if (separator == null)
                {
                    separator = new ToolStripSeparator { Name = "CustomSeparator" };
                    menuItem.DropDownItems.Add(separator);       // put a separator
                }
                else
                {
                    var index = menuItem.DropDownItems.IndexOf(separator) + 1;

                    while (menuItem.DropDownItems.Count > index)
                    {
                        menuItem.DropDownItems.RemoveAt(index);
                    }
                }

                // Add the custom report items to the insert menu
                foreach (var m in sa)
                {
                    var mi = new ToolStripMenuItem(m + "...");
                    mi.Click += InsertToolStripMenuItem_Click;
                    mi.Tag = m;
                    menuItem.DropDownItems.Add(mi);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format(Strings.DesignCtl_ShowB_CustomReportItemError, ex.Message), Strings.DesignCtl_Show_Insert, MessageBoxButtons.OK);
            }
        }
RdlDesigner