private MenuItem AddLockedItem(Menu menu, BaseFieldInfo fieldInfo)
        {
            var newitem = new MenuItem(fieldInfo.Name, fieldInfo.Description)
            {
                Enabled   = false,
                RightIcon = MenuItem.Icon.LOCK,
                ItemData  = fieldInfo,
            };

            menu.AddMenuItem(newitem);
            return(newitem);
        }
        public static void ParseXml(string xml)
        {
            xml = Helpers.RemoveByteOrderMarks(xml);
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);

            foreach (XmlNode classNode in doc.ChildNodes)
            {
                if (classNode.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }

                string className = classNode.Name;

                foreach (XmlNode item in classNode.ChildNodes)
                {
                    if (item.NodeType == XmlNodeType.Comment)
                    {
                        continue;
                    }

                    string name = item.Name;
                    Type   type = FieldType.GetFieldType(name);

                    bool   editable    = bool.Parse(item.Attributes["Editable"].Value);
                    string description = item["Description"].InnerText;

                    var minNode = item["Min"];
                    var maxNode = item["Max"];

                    if (type == FieldType.FloatType)
                    {
                        float min = float.Parse(minNode.Attributes["value"].Value);
                        float max = float.Parse(maxNode.Attributes["value"].Value);

                        FieldInfo <float> fieldInfo = new FieldInfo <float>(name, className, description, editable, min, max);
                        FieldsInfo[name] = fieldInfo;
                    }

                    else if (type == FieldType.IntType)
                    {
                        int min = int.Parse(minNode.Attributes["value"].Value);
                        int max = int.Parse(maxNode.Attributes["value"].Value);

                        FieldInfo <int> fieldInfo = new FieldInfo <int>(name, className, description, editable, min, max);
                        FieldsInfo[name] = fieldInfo;
                    }

                    else if (type == FieldType.Vector3Type)
                    {
                        Vector3 min = new Vector3(
                            float.Parse(minNode.Attributes["x"].Value),
                            float.Parse(minNode.Attributes["y"].Value),
                            float.Parse(minNode.Attributes["z"].Value));

                        Vector3 max = new Vector3(
                            float.Parse(maxNode.Attributes["x"].Value),
                            float.Parse(maxNode.Attributes["y"].Value),
                            float.Parse(maxNode.Attributes["z"].Value));

                        FieldInfo <Vector3> fieldInfo = new FieldInfo <Vector3>(name, className, description, editable, min, max);
                        FieldsInfo[name] = fieldInfo;
                    }

                    else if (type == FieldType.StringType)
                    {
                        BaseFieldInfo fieldInfo = new BaseFieldInfo(name, className, description, editable);
                        FieldsInfo[name] = fieldInfo;
                    }

                    else
                    {
                        BaseFieldInfo fieldInfo = new BaseFieldInfo(name, className, description, editable);
                        FieldsInfo[name] = fieldInfo;
                    }
                }
            }
        }