private type_generationGenerateentityCustomcreatemethod CreateCreateMethod(string pDef)
        {
            //create new entry
            type_generationGenerateentityCustomcreatemethod m = new type_generationGenerateentityCustomcreatemethod();

            //get the single tokens
            string[] astrTokens = pDef.Split(',');
            for (int intIndex = 0; intIndex < astrTokens.Length; intIndex++)
            {
                astrTokens[intIndex] = astrTokens[intIndex].Replace("%%;%%", ",");
            }

            //first token is the method name
            m.name = astrTokens[0];

            //get the attributes to filter the query
            ArrayList alAttr   = new ArrayList();
            int       intCount = 1;

            while (intCount < astrTokens.Length)
            {
                type_generationGenerateentityCustomcreatemethodMethodattribute attr =
                    new type_generationGenerateentityCustomcreatemethodMethodattribute();
                attr.name = astrTokens[intCount];

                alAttr.Add(attr);
                intCount++;
            }

            //Set the found attributes
            m.methodattribute = (type_generationGenerateentityCustomcreatemethodMethodattribute[])
                                alAttr.ToArray(typeof(type_generationGenerateentityCustomcreatemethodMethodattribute));

            return(m);
        }
        public void Initialize()
        {
            malAll = new ArrayList();
            foreach (XmlNode node in mDbDefinitionDocument.SelectNodes("/db-definition/entities/entity[@name='" + mEntity + "']/attributes/attribute"))
            {
                if (mCustomCreateMethod != null)
                {
                    type_generationGenerateentityCustomcreatemethodMethodattribute attr = new type_generationGenerateentityCustomcreatemethodMethodattribute();
                    attr.name = node.Attributes["name"].Value;
                    malAll.Add(attr);
                }
                else if (mCustomFindMethod != null)
                {
                    type_generationGenerateentityCustomfindmethodMethodattribute attr = new type_generationGenerateentityCustomfindmethodMethodattribute();
                    attr.name = node.Attributes["name"].Value;
                    malAll.Add(attr);
                }
            }

            malSelected = new ArrayList();
            if (mCustomCreateMethod != null && mCustomCreateMethod.methodattribute != null)
            {
                foreach (type_generationGenerateentityCustomcreatemethodMethodattribute attr in mCustomCreateMethod.methodattribute)
                {
                    foreach (type_generationGenerateentityCustomcreatemethodMethodattribute attr2 in malAll)
                    {
                        if (attr.name.Equals(attr2.name))
                        {
                            malSelected.Add(attr2);
                            break;
                        }
                    }
                }
            }
            else if (mCustomFindMethod != null && mCustomFindMethod.methodattribute != null)
            {
                foreach (type_generationGenerateentityCustomfindmethodMethodattribute attr in mCustomFindMethod.methodattribute)
                {
                    bool fFound = false;
                    foreach (type_generationGenerateentityCustomfindmethodMethodattribute attr2 in malAll)
                    {
                        if (attr.name.Equals(attr2.name))
                        {
                            malSelected.Add(attr2);
                            fFound = true;
                            break;
                        }
                    }
                    if (!fFound && attr.typeSpecified)
                    {
                        type_generationGenerateentityCustomfindmethodMethodattribute attr2 = new type_generationGenerateentityCustomfindmethodMethodattribute();
                        attr2.name          = attr.name;
                        attr2.type          = attr.type;
                        attr2.typeSpecified = true;
                        attr2.entityalias   = attr.entityalias;
                        malSelected.Add(attr2);
                    }
                }
            }

            LoadAttributes();
        }