public void GetFieldDataTypes(SQLBuilder sqlb)
        {
            XSDAdapter xsda = new XSDAdapter(_physappath);

            SetFilterFieldDataTypes(sqlb, xsda);

            SetDataFieldDataTypes(sqlb, xsda);
        }
        public void SetFieldDataTypes(SQLBuilder sqlb)
        {
            XSDAdapter xsda = new XSDAdapter(PhysicalAppPath);

            SetFilterFieldDataTypes(sqlb, xsda);

            SetDataFieldDataTypes(sqlb, xsda);
        }
        private void SetDataFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            //only get datafield types when not sql select or sql delete
            if (sqlb.SQLtype != snpSQLtype.sqlSelect && sqlb.SQLtype != snpSQLtype.sqlDelete)
            {
                string[] fields = GetDataFieldNames(sqlb);

                string[] datatypes = xsda.GetDataTypes(_xsdn, fields);

                SetDataFieldsDataType(sqlb, datatypes);
            }
        }
示例#4
0
        private void bttnGo_Click(object sender, EventArgs e)
        {
            var mySchema = XSDAdapter.Read(txtFileName.Text);

            mySchema.Compile(XSDAdapter.CompileCallback);

            sb   = new StringBuilder();
            sbts = new StringBuilder();

            txtLog.Text        = mySchema.Namespaces.Count.ToString() + "\r\n";
            txtTabStopped.Text = "";

            sb.Append(string.Format("Es sind {0} Elemente vorhanden:\r\n", mySchema.Elements.Count));

            foreach (XmlSchemaElement item in mySchema.Elements.Values)
            {
                OutputSchemaElement(item, 1);
            }

            txtLog.Text       += sb.ToString();
            txtTabStopped.Text = sbts.ToString();
            sb.Clear();
            sbts.Clear();
        }
        private void SetDataFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            //SMELL : functie met duidelijk naam ipv. comment

            //SMELL : level of abstraction

            //only get datafield types when not sql select or sql delete
            if (sqlb.SQLtype != snpSQLtype.sqlSelect && sqlb.SQLtype != snpSQLtype.sqlDelete)
            {
                //SMELL : "fields" en "datatypes"
                //kunnen samengebracht worden in 1 nieuwe functie :
                //GetFilterFieldDatatypes
                //dat onmiddellijk string[] datatypes teruggeeft
                string[] fields = GetDataFieldNames(sqlb);

                string[] datatypes = xsda.GetDataTypes(XsdName, fields);
                //end SMELL

                SetDataFieldsDataType(sqlb, datatypes);
            }
        }
        private void SetFilterFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            if (sqlb.FilterFields.Count > 0)
            {
                //SMELL : "fields" en "datatypes"
                //kunnen samengebracht worden in 1 nieuwe functie :
                //GetFilterFieldDatatypes
                //dat onmiddellijk string[] datatypes teruggeeft
                string[] fields = GetFilterFieldNames(sqlb);

                string[] datatypes = xsda.GetDataTypes(XsdName, fields);
                //end SMELL

                SetFilterFieldsDataType(sqlb, datatypes);
            }
        }
        private void SetFilterFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            if (sqlb.FilterFields.Count > 0)
            {
                string[] fields = GetFilterFieldNames(sqlb);

                string[] datatypes = xsda.GetDataTypes(_xsdn, fields);

                SetFilterFieldsDataType(sqlb, datatypes);
            }
        }
        private static string[] GetFilterFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            string[] fields = GetFilterFieldNames(sqlb);

            return xsda.GetDataTypes(XsdName, fields);
        }
        private void SetFilterFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            if (sqlb.FilterFields.Count > 0)
            {
                string[] datatypes = GetFilterFieldDataTypes(sqlb, xsda);

                SetFieldDataType(sqlb, datatypes, typeof (FilterField));
            }
        }
        private static void SetDataFieldDataTypes(SQLBuilder sqlb, XSDAdapter xsda)
        {
            if (MustSetDataFieldDataTypes(sqlb))
            {
                string[] datatypes = GetDataFieldDataTypes(sqlb, xsda);

                SetFieldDataType(sqlb, datatypes, typeof (DataField));
            }
        }