Beispiel #1
0
        public static void UpdateContextMenuStrip(ref ContextMenuStrip cxtMenuStrip, string[] branchFiles)
        {
            cxtMenuStrip.Items.Clear();

            foreach (string file in branchFiles)
            {
                try
                {
                    // Read BranchMenu from JSON file
                    var branchMenu = HelperSmartOp.JSONToBranchMenu(file);
                    // Add new BranchMenu to ContextMenuStrip
                    AddBranchToContextMenuStrip(ref cxtMenuStrip, branchMenu);
                }
                catch { }
            }

            //RemoveAllItems(ref cxtMenuStrip);
        }
Beispiel #2
0
        //BranchMenu yü ContextMenuStrip e dönüştür
        public static ContextMenuStrip BranchFilesToContextMenuStrip(string[] branchFiles)
        {
            ContextMenuStrip returnObj = new ContextMenuStrip();

            foreach (string file in branchFiles)
            {
                try
                {
                    // Read BranchMenu from JSON file
                    var branchMenu = HelperSmartOp.JSONToBranchMenu(file);

                    // Add new BranchMenu to ContextMenuStrip
                    AddBranchToContextMenuStrip(ref returnObj, branchMenu);
                }
                catch { }
            }

            return(returnObj);
        }