Esempio n. 1
0
        private void CreateChangePropertiesMenuItem(string propertyPath, TreeNode parentNode, string section, string itemName, MOG_PropertiesIni ripMenu)
        {
            string command = ripMenu.GetPropertyString(section, "MenuItem", itemName);

            // Check to see if this command is another sub menu
            if (ripMenu.SectionExist(command))
            {
                TreeNode propertyMenuItem = CreatePropertyMenuNode(parentNode, itemName);
                CreateChangePropertiesSubMenu(propertyPath, propertyMenuItem, command, ripMenu);
            }
            else
            {
                string   globalSection, propertySection, key, val;
                string[] leftParts = command.Split("=".ToCharArray());
                if (leftParts.Length < 2)
                {
                    string title   = "Change Properties Failed";
                    string message = "Invalid property format specified.\n" +
                                     "Specified Format: " + command + "\n" +
                                     "   Proper Format: [Section]{PropertyGroup}PropertyName=PropertyValue";
                    MOG_Prompt.PromptMessage(title, message);
                    return;
                }
                else
                {
                    string[] testParts = leftParts[0].Split("[]{}".ToCharArray());
                    if (testParts.Length != 5)
                    {
                        string title   = "Change Properties Failed";
                        string message = "Invalid property format specified.\n" +
                                         "Specified Format: " + command + "\n" +
                                         "   Proper Format: [Section]{PropertyGroup}PropertyName=PropertyValue";
                        MOG_Prompt.PromptMessage(title, message);
                        return;
                    }
                    else
                    {
                        try
                        {
                            globalSection   = testParts[1];
                            propertySection = testParts[3];
                            key             = testParts[4];
                            val             = command.Substring(command.IndexOf("=") + 1);
                        }
                        catch
                        {
                            string title   = "Change Properties Failed";
                            string message = "Invalid property format specified.\n" +
                                             "Specified Format: " + command + "\n" +
                                             "   Proper Format: [Section]{PropertyGroup}PropertyName=PropertyValue";
                            MOG_Prompt.PromptMessage(title, message);
                            return;
                        }
                    }

                    CreatePropertyNode(parentNode, itemName, globalSection, propertySection, key, val);
                }
            }
        }
Esempio n. 2
0
        public void Load(MOG_PropertiesIni ini, string section, string property, string key)
        {
            if (ini.PropertyExist(section, property, key + "_OpenWidth"))
            {
                mOpenWidth = Convert.ToInt32(ini.GetPropertyString(section, property, key + "_OpenWidth"));
            }

            if (ini.PropertyExist(section, property, key + "_CLoseWidth"))
            {
                mCloseWidth = Convert.ToInt32(ini.GetPropertyString(section, property, key + "_CLoseWidth"));
            }

            if (ini.PropertyExist(section, property, key + "_Open"))
            {
                Opened = Convert.ToBoolean(ini.GetPropertyString(section, property, key + "_Open"));
            }
        }
Esempio n. 3
0
        static private bool LoadDynamic_LayoutListView(ListView view, string section, string key)
        {
            try
            {
                if (Settings != null)
                {
                    foreach (ColumnHeader column in view.Columns)
                    {
                        if (Settings.PropertyExist(section, key, column.Text + "_width"))
                        {
                            column.Width = Convert.ToInt32(Settings.GetPropertyString(section, key, column.Text + "_width"));
                        }
                    }
                }
            }
            catch
            {
            }

            return(true);
        }