Ejemplo n.º 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;
        }
Ejemplo n.º 2
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
        }