/// <summary> /// generates one cedent to XML string /// </summary> /// <param name="subcedents">boxes with subcedents</param> /// <returns>XML string</returns> private static string getOneCedentXML(IBoxModule[] subcedents) { string XML = ""; #region Loop - processing of each partial cedent foreach (IBoxModule box in subcedents) // must be boxes with ID = "DataMiningCommon.CategorialPartialCedentSetting" { Rec_sub_KL_cedent rSKLC = new Rec_sub_KL_cedent(); // setting attribute "name" rSKLC.name = box.UserName; // setting attribute "length" rSKLC.length = box.GetPropertyLong("MinLen").ToString() + " - " + box.GetPropertyLong("MaxLen").ToString(); // searching each KL literal (= attributes!) string[] AttrIDs = { "DataMiningCommon.Attributes.Attribute", "DataMiningCommon.Attributes.EquifrequencyIntervalsAttribute", "DataMiningCommon.Attributes.EquidistantIntervalsAttribute", "DataMiningCommon.Attributes.EachValueOneCategoryAttribute" }; IBoxModule[] attributes = BoxesHelper.ListDirectAncestBoxesWithID(box, AttrIDs); // setting attribute "literal_cnt" (literals count) rSKLC.literal_cnt = attributes.Length; List <Rec_KL_literal> rLiterals = new List <Rec_KL_literal>(); #region Loop - processing of each KL-literal (attribute) foreach (IBoxModule attrBox in attributes) { Rec_KL_literal rLiteral = new Rec_KL_literal(); // setting "underlying_attribute" rLiteral.underlying_attribute = attrBox.GetPropertyString("NameInLiterals"); // setting "category_cnt" rLiteral.category_cnt = attrBox.GetPropertyLong("CountOfCategories"); rLiterals.Add(rLiteral); } #endregion // adding cedent to XML string XML += rSKLC.ToXML(rLiterals); } #endregion return(XML); }
/// <summary> /// generates one cedent to XML string /// </summary> /// <param name="subcedents">boxes with subcedents</param> /// <returns>XML string</returns> private static string getOneCedentXML(IBoxModule[] subcedents) { string XML = ""; #region Loop - processing of each partial cedent foreach (IBoxModule box in subcedents) // must be boxes with ID = "DataMiningCommon.CategorialPartialCedentSetting" { Rec_sub_KL_cedent rSKLC = new Rec_sub_KL_cedent(); // setting attribute "name" rSKLC.name = box.UserName; // setting attribute "length" rSKLC.length = box.GetPropertyLong("MinLen").ToString() + " - " + box.GetPropertyLong("MaxLen").ToString(); // searching each KL literal (= attributes!) string[] AttrIDs = { "DataMiningCommon.Attributes.Attribute", "DataMiningCommon.Attributes.EquifrequencyIntervalsAttribute", "DataMiningCommon.Attributes.EquidistantIntervalsAttribute", "DataMiningCommon.Attributes.EachValueOneCategoryAttribute" }; IBoxModule[] attributes = BoxesHelper.ListDirectAncestBoxesWithID(box, AttrIDs); // setting attribute "literal_cnt" (literals count) rSKLC.literal_cnt = attributes.Length; List<Rec_KL_literal> rLiterals = new List<Rec_KL_literal>(); #region Loop - processing of each KL-literal (attribute) foreach (IBoxModule attrBox in attributes) { Rec_KL_literal rLiteral = new Rec_KL_literal(); // setting "underlying_attribute" rLiteral.underlying_attribute = attrBox.GetPropertyString("NameInLiterals"); // setting "category_cnt" rLiteral.category_cnt = attrBox.GetPropertyLong("CountOfCategories"); rLiterals.Add(rLiteral); } #endregion // adding cedent to XML string XML += rSKLC.ToXML(rLiterals); } #endregion return XML; }