Exemple #1
0
        /// <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;
        }
Exemple #2
0
 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;
 }
Exemple #3
0
        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
        }
Exemple #4
0
 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();
     }
 }
Exemple #5
0
 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("/");
         }
     }
 }
Exemple #6
0
 public static OptionMap File(String filename)
 {
     if (options == null)
     {
         options = new OptionMap();
     }
     if (filename == null)
     {
         return(options);
     }
     return(options[filename]);
 }
Exemple #7
0
 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");
         }
     }
 }
Exemple #8
0
 public OptionEditor(OptionMap map)
 {
     InitializeComponent();
     this.map = map;
 }
Exemple #9
0
 internal OptionEntry(OptionMap section, string s, object option_id)
 {
     this.section = section;
     m_name       = s;
     sub_options  = new OptionMap(this, option_id);
 }
Exemple #10
0
        public static OptionMap Database(DsnConnection db)
        {
            OptionMap tmp_options = new OptionMap(db);

            return(tmp_options);
        }