Пример #1
0
        public DcTable GetSubTable(string name)
        {
            DcTable tab = null;
            if (StringSimilarity.SameTableName(Name, name))
            {
                tab = this;
            }

            foreach (DcColumn col in SubColumns)
            {
                if (tab != null) break;
                tab = col.Input.GetSubTable(name);
            }

            return tab;
        }
Пример #2
0
        /// <summary>
        /// Creae storage for the function and its definition depending on the output set type.
        /// </summary>
        /// <returns></returns>
        public static DcColumnData CreateColumnData(DcTable type, DcColumn column)
        {
            DcColumnData colData = new ColumnDataEmpty();

            /*
             * if (column.Input != null && column.Input.Schema != null && column.Input.Schema.GetType() != typeof(Schema)) // Import col
             * {
             * }
             * else if (column.Output != null && column.Output.Schema != null && column.Output.Schema.GetType() != typeof(Schema)) // Output col
             * {
             * }
             */
            if (column.Input == null || column.Output == null)
            {
            }
            if (type == null || string.IsNullOrEmpty(type.Name))
            {
            }
            else if (StringSimilarity.SameTableName(type.Name, "Void"))
            {
            }
            else if (StringSimilarity.SameTableName(type.Name, "Top"))
            {
            }
            else if (StringSimilarity.SameTableName(type.Name, "Bottom")) // Not possible by definition
            {
            }
            else if (StringSimilarity.SameTableName(type.Name, "Root"))
            {
            }
            else if (StringSimilarity.SameTableName(type.Name, "Integer"))
            {
                colData = new ColumnData <int>(column);
            }
            else if (StringSimilarity.SameTableName(type.Name, "Double"))
            {
                colData = new ColumnData <double>(column);
            }
            else if (StringSimilarity.SameTableName(type.Name, "Decimal"))
            {
                colData = new ColumnData <decimal>(column);
            }
            else if (StringSimilarity.SameTableName(type.Name, "String"))
            {
                colData = new ColumnData <string>(column);
            }
            else if (StringSimilarity.SameTableName(type.Name, "Boolean"))
            {
                colData = new ColumnData <bool>(column);
            }
            else if (StringSimilarity.SameTableName(type.Name, "DateTime"))
            {
                colData = new ColumnData <DateTime>(column);
            }
            else if (StringSimilarity.SameTableName(type.Name, "Set"))
            {
            }
            else // User (non-primitive) set
            {
                colData = new ColumnData <int>(column);
            }

            return(colData);
        }
Пример #3
0
 public virtual DcSchema GetSchema(string name)
 {
     return(_schemas.FirstOrDefault(x => StringSimilarity.SameTableName(x.Name, name)));
 }
Пример #4
0
        public virtual DcTable GetPrimitiveType(string name)
        {
            DcColumn col = SubColumns.FirstOrDefault(x => StringSimilarity.SameTableName(x.Input.Name, name));

            return(col != null ? col.Input : null);
        }