public OptionEntry this[string entryName] { get { sub_options.ReadBranch(); OptionEntry result = Search(entryName, null, null); if (result != null) { return(result); } OptionEntry blank = new OptionEntry(this.sub_options, entryName); sub_options.Add(blank); return(blank); } }
public OptionEntry this[string entryName, bool DefaultValue] { get { //this. sub_options.ReadBranch(); OptionEntry entry = Search(entryName, DefaultValue.ToString(), null); if (entry != null) { return(entry); } OptionEntry blank = new OptionEntry(this.sub_options, entryName); blank.Bool = DefaultValue; sub_options.Add(blank); return(blank); } }
public OptionEntry this[string entryName, string DefaultValue, string Description] { get { //this. sub_options.ReadBranch(); OptionEntry entry = Search(entryName, DefaultValue, Description); if (entry != null) { return(entry); } OptionEntry blank = new OptionEntry(this, entryName, Description); blank.Value = DefaultValue; sub_options.Add(blank); return(blank); } //set { } }
internal OptionTreeNode(OptionEntry e) { this.e = e; this.Text = this.ToString(); }
OptionEntry Search(string entryName, string default_val, string description) { if (CheckIsPath(entryName)) { String here; String there; SplitPath(entryName, out here, out there); foreach (OptionEntry entry in sub_options) { if (String.Compare(entry.ToString(), here, true) == 0) { return(entry[there, default_val, description]); } } OptionEntry blank; if (description == null) { blank = new OptionEntry(this.sub_options, here); } else { blank = new OptionEntry(this.sub_options, here, description); } if (default_val != null) { if (section.fallback_ini) { blank.Value = INI.Default[blank.INISectionName][blank.m_name, default_val]; } else { if (INIControl.DialogEnable) { INIForm form = new INIForm(entryName, default_val); form.ShowDialog(); blank.Value = form.ToString(); } else { blank.Value = default_val; } } } sub_options.Add(blank); return(blank[there, default_val, description]); } else { foreach (OptionEntry entry in sub_options) { if (String.Compare(entry.ToString(), entryName, true) == 0) { return(entry); } } OptionEntry blank = new OptionEntry(sub_options, entryName, description); if (default_val != null) { if (section.fallback_ini) { blank.Value = INI.Default[blank.INISectionName][blank.m_name, default_val]; } else { if (INIControl.DialogEnable) { INIForm form = new INIForm(entryName, default_val); form.ShowDialog(); blank.Value = form.ToString(); } else { blank.Value = default_val; } } } sub_options.Add(blank); return(blank); } //return null; }