SparkleLib.SparkleConfig.SetFolderOptionalAttribute C# (CSharp) Method

SetFolderOptionalAttribute() public method

public SetFolderOptionalAttribute ( string folder_name, string key, string value ) : bool
folder_name string
key string
value string
return bool
        public bool SetFolderOptionalAttribute(string folder_name, string key, string value)
        {
            XmlNode folder = GetFolder (folder_name);

            if (folder == null)
                return false;

            if (folder [key] != null) {
                folder [key].InnerText = value;

            } else {
                XmlNode new_node = CreateElement (key);
                new_node.InnerText = value;
                folder.AppendChild (new_node);
            }

            Save ();

            return true;
        }