BExIS.Ddm.Providers.LuceneProvider.SearchDesigner.SetAttributesToNode C# (CSharp) Method

SetAttributesToNode() private method

private SetAttributesToNode ( XmlElement xmlElement, SearchAttribute sa ) : XmlElement
xmlElement System.Xml.XmlElement
sa BExIS.Ddm.Model.SearchAttribute
return System.Xml.XmlElement
        private XmlElement SetAttributesToNode(XmlElement xmlElement, SearchAttribute sa)
        {
            // names
            XmlAttribute xa = this._configXML.CreateAttribute("display_name");
            xa.Value = sa.displayName;
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("lucene_name");
            xa.Value = sa.sourceName;
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("metadata_name");
            xa.Value = sa.metadataName;
            xmlElement.Attributes.Append(xa);

            //types
            xa = this._configXML.CreateAttribute("type");
            xa.Value = SearchAttribute.GetSearchTypeAsString(sa.searchType);
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("primitive_type");
            xa.Value = SearchAttribute.GetDataTypeAsString(sa.dataType);
            xmlElement.Attributes.Append(xa);

            // parameter for index
            xa = this._configXML.CreateAttribute("store");
            xa.Value = SearchAttribute.GetBooleanAsString(sa.store);
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("multivalued");
            xa.Value = SearchAttribute.GetBooleanAsString(sa.multiValue);
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("analysed");
            xa.Value = SearchAttribute.GetBooleanAsString(sa.analysed);
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("norm");
            xa.Value = SearchAttribute.GetBooleanAsString(sa.norm);
            xmlElement.Attributes.Append(xa);

            //boost
            xa = this._configXML.CreateAttribute("boost");
            xa.Value = sa.boost.ToString();
            xmlElement.Attributes.Append(xa);

            // ResultView
            xa = this._configXML.CreateAttribute("header_item");
            xa.Value = SearchAttribute.GetBooleanAsString(sa.headerItem);
            xmlElement.Attributes.Append(xa);

            xa = this._configXML.CreateAttribute("default_visible_item");
            xa.Value = SearchAttribute.GetBooleanAsString(sa.defaultHeaderItem);
            xmlElement.Attributes.Append(xa);

            // properties
            if (sa.searchType.Equals(SearchComponentBaseType.Property))
            {
                xa = this._configXML.CreateAttribute("direction");
                xa.Value = SearchAttribute.GetDirectionAsString(sa.direction);
                xmlElement.Attributes.Append(xa);

                xa = this._configXML.CreateAttribute("uiComponent");
                xa.Value = SearchAttribute.GetUIComponentAsString(sa.uiComponent);
                xmlElement.Attributes.Append(xa);

                xa = this._configXML.CreateAttribute("aggregationType");
                xa.Value = SearchAttribute.GetAggregationTypeAsString(sa.aggregationType);
                xmlElement.Attributes.Append(xa);

                xa = this._configXML.CreateAttribute("date_format");
                xa.Value = sa.dateFormat;
                xmlElement.Attributes.Append(xa);

            }

            return xmlElement;
        }