Ejemplo n.º 1
0
        /// <summary>
        /// Generates one CF cedent to XML string.
        /// </summary>
        /// <param name="subcedents">boxes with parcial cedents</param>
        /// <returns>XML string</returns>
        private static string getOneCedentXML(IBoxModule[] subcedents)
        {
            string XML = "";

            #region Loop - processing of each parcial cedent

            foreach (IBoxModule box in subcedents)  // must be boxes with ID = "DataMiningCommon.CategorialPartialCedentSetting"
            {
                Rec_sub_CF_cedent rSCFC = new Rec_sub_CF_cedent();
                // setting attribute "name"
                rSCFC.name = box.UserName;
                // setting attribute "length"
                rSCFC.length = box.GetPropertyLong("MinLen").ToString() + " - " + box.GetPropertyLong("MaxLen").ToString();

                // searching each CF literal (= attribute!)
                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)
                rSCFC.literal_cnt = attributes.Length;
                List <Rec_CF_literal> rLiterals = new List <Rec_CF_literal>();

                #region Loop - processing of each CF-literal (attribute)

                foreach (IBoxModule attrBox in attributes)
                {
                    Rec_CF_literal rLiteral = new Rec_CF_literal();
                    // setting attribute "underlying_attribute"
                    rLiteral.underlying_attribute = attrBox.GetPropertyString("NameInLiterals");
                    // setting attribute "category_cnt"
                    rLiteral.category_cnt = attrBox.GetPropertyLong("CountOfCategories");
                    rLiterals.Add(rLiteral);
                }
                #endregion

                // adding parcial cedent (and its literals) to result XML string
                XML += rSCFC.ToXML(rLiterals);
            }
            #endregion

            return(XML);
        }
        /// <summary>
        /// Generates one CF cedent to XML string.
        /// </summary>
        /// <param name="subcedents">boxes with parcial cedents</param>
        /// <returns>XML string</returns>
        private static string getOneCedentXML(IBoxModule[] subcedents)
        {
            string XML = "";

            #region Loop - processing of each parcial cedent

            foreach (IBoxModule box in subcedents)  // must be boxes with ID = "DataMiningCommon.CategorialPartialCedentSetting"
            {
                Rec_sub_CF_cedent rSCFC = new Rec_sub_CF_cedent();
                // setting attribute "name"
                rSCFC.name = box.UserName;
                // setting attribute "length"
                rSCFC.length = box.GetPropertyLong("MinLen").ToString() + " - " + box.GetPropertyLong("MaxLen").ToString();

                // searching each CF literal (= attribute!)
                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)
                rSCFC.literal_cnt = attributes.Length;
                List<Rec_CF_literal> rLiterals = new List<Rec_CF_literal>();

                #region Loop - processing of each CF-literal (attribute)

                foreach (IBoxModule attrBox in attributes)
                {
                    Rec_CF_literal rLiteral = new Rec_CF_literal();
                    // setting attribute "underlying_attribute"
                    rLiteral.underlying_attribute = attrBox.GetPropertyString("NameInLiterals");
                    // setting attribute "category_cnt"
                    rLiteral.category_cnt = attrBox.GetPropertyLong("CountOfCategories");
                    rLiterals.Add(rLiteral);
                }
                #endregion

                // adding parcial cedent (and its literals) to result XML string
                XML += rSCFC.ToXML(rLiterals);
            }
            #endregion

            return XML;
        }