예제 #1
0
        internal void ToSettings(string indexName, Dictionary <string, string> settings, bool isSubField)
        {
            var category = "Index-" + indexName.ToLower() + "-Fields-" + this.Name.ToLower();

            Lib.AddSettingAsNeeded(settings, category, "IsSubField", isSubField.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Name", this.Name, true);

            Lib.AddSettingAsNeeded(settings, category, "Ordinal", Ordinal.ToString(), true);


            Lib.AddSettingAsNeeded(settings, category, "Value", ("" + Value).ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsPrimaryKey", IsPrimaryKey.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "StoredInIndex", StoredInIndex.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Searchable", Searchable.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Format", Format.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "Type", DataType.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsBoolean", IsBoolean.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "TrueValue", TrueValue.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsCreatedDate", IsCreatedDate.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "IsModifiedDate", IsModifiedDate.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "ForeignKeyTable", ForeignKeyTable.ToString(), true);

            Lib.AddSettingAsNeeded(settings, category, "ForeignKeyField", ForeignKeyField.ToString(), true);


            Lib.AddSettingAsNeeded(settings, category, "Calculation", Calculation.ToString(), true);
            foreach (Field sf in this.SubFields)
            {
                sf.ToSettings(indexName, settings, true);
            }
        }
예제 #2
0
        internal Node ToXmlNode()
        {
            Node nd = new Node("Field");

            nd.Attributes.SetValue("Ordinal", Ordinal.ToString());
            nd.Attributes.SetValue("Name", Name);
            if (Value != null)
            {
                nd.Attributes.SetValue("Value", Value.ToString());
            }
            nd.Attributes.SetValue("IsPrimaryKey", IsPrimaryKey.ToString());
            nd.Attributes.SetValue("StoredInIndex", StoredInIndex.ToString());
            nd.Attributes.SetValue("Searchable", Searchable.ToString());
            nd.Attributes.SetValue("Format", Format);
            if (DataType != null)
            {
                nd.Attributes.SetValue("Type", DataType.ToString());
            }

            nd.Attributes.SetValue("IsBoolean", IsBoolean.ToString());
            nd.Attributes.SetValue("TrueValue", TrueValue);

            nd.Attributes.SetValue("IsCreatedDate", IsCreatedDate.ToString());
            nd.Attributes.SetValue("IsModifedDate", IsModifiedDate.ToString());

            nd.Attributes.SetValue("ForeignKeyTable", ForeignKeyTable);
            nd.Attributes.SetValue("ForeignKeyField", ForeignKeyField);


            nd.Attributes.SetValue("Calculation", Calculation);
            foreach (Field sf in this.SubFields)
            {
                nd.Nodes.Add(sf.ToXmlNode());
            }

            return(nd);
        }