/// <summary> /// creates an option entry with specified name(s) and descriptoin /// </summary> /// <param name="section">the section that contains this new entry</param> /// <param name="s">the name of the entry</param> /// <param name="description">the descriptiion of the entry.</param> internal OptionEntry(OptionMap section, string s, string description) { OptionMapDataset4 ds = section.ds; object name_id = ds.name.GetNameID(section.db, s); // section.names[s]; object ID; if (section.root.option_map_key_type == typeof(Guid)) { DataRow row = ds.CreateOption(section.db, ID = DsnConnection.GetGUID(section.db), section.ID, name_id); if (description != null) { row["description"] = description; } } else { DataRow row = ds.CreateOption(section.db, section.ID, name_id); ID = row[ds.map.option_idColumn]; if (description != null) { row["description"] = description; } } sub_options = new OptionMap(this, ID); this.section = section; m_name = s; }
internal OptionEntry(OptionMap section, object ID, string name, string value) { this.section = section; sub_options = new OptionMap(this, ID); m_name = name; m_value = value; }
internal OptionEntry(OptionMap section, string s) { OptionMapDataset4 ds = section.ds; object name_id = ds.name.GetNameID(section.db, s); // section.names[s]; object ID; if (section.root.option_map_key_type == typeof(Guid)) { ds.CreateOption(section.db, ID = DsnConnection.GetGUID(section.db), section.ID, name_id); } else { ID = ds.CreateOption(section.db, section.ID, name_id); } sub_options = new OptionMap(this, ID); this.section = section; m_name = s; return; #if asdfasdf object name_id = section.names[s]; object option_id; if (!section.fallback_ini) { option_id = section.db.KindExecuteInsert("insert into " + OptionMap.Prefix + "map(parent_option_id,name_id) values('" + section.ID + "','" + name_id + "')"); } else { option_id = 1; } this.section = section; sub_options = new OptionMap(this, option_id); m_name = s; #endif }
internal OptionEntry(OptionMap section, object ID, string name, DataRow[] value) { this.section = section; sub_options = new OptionMap(this, ID); m_name = name; if (value != null && value.Length > 0) { m_value = value[0][section.ds.values.stringColumn].ToString(); } }
void RecurseName(StringBuilder sb, int level, OptionMap map) { if (map.parent != null) { RecurseName(sb, level + 1, map.parent.section); sb.Append(map.parent.Name); if (level != 0) { sb.Append("/"); } } }
public static OptionMap File(String filename) { if (options == null) { options = new OptionMap(); } if (filename == null) { return(options); } return(options[filename]); }
void PopulateTree() { treeView1.Nodes.Clear(); if (map == null) { map = Options.options; // Default; } if (map == null) { return; } foreach (OptionEntry e in map) { TreeNode node; if (!e.section.ID.Equals(e.sub_options.ID)) { this.treeView1.Nodes.Add(node = new OptionTreeNode(e)); ((OptionMap)e).ReadBranch(); node.Collapse(); node.Nodes.Add("blank"); } } }
public OptionEditor(OptionMap map) { InitializeComponent(); this.map = map; }
internal OptionEntry(OptionMap section, string s, object option_id) { this.section = section; m_name = s; sub_options = new OptionMap(this, option_id); }
public static OptionMap Database(DsnConnection db) { OptionMap tmp_options = new OptionMap(db); return(tmp_options); }