コード例 #1
0
        //=========================================================================================
        CompletionVariantList Get_Variants_For_Items_1(List <SourceInfo> sources)
        {
            CompletionVariantList items = null;

            //Колонки из указанных источников
            foreach (var oSource in sources)
            {
                string sSchema = !string.IsNullOrEmpty(oSource.Schema) ? oSource.Schema : this.DefaultSchema;
                var    names   = this.InfoProvider.GetColumnsFor(this.DropBrackets(sSchema), this.DropBrackets(oSource.Name));
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Columns);
            }
            //Указанные источники (таблицы)
            foreach (var oSource in sources)
            {
                string sName = !string.IsNullOrEmpty(oSource.Alias) ? oSource.Alias : oSource.Name;
                items = CompletionVariantList.Combine(items, sName, DataBaseLevel.Table);
            }
            //Таблицы из схемы по умолчанию
            {
                var names = this.InfoProvider.GetObjectsInSchema(this.DropBrackets(this.DefaultSchema));
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Table);
            }
            //Схемы
            {
                var names = this.InfoProvider.GetSchemas();
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Schema);
            }
            return(items);
        }
コード例 #2
0
        //=========================================================================================
        CompletionVariantList Get_Variants_For_Items_2(string first, List <SourceInfo> sources)
        {
            SourceInfo oCurrentSource = null;

            foreach (var oSource in sources)
            {
                string sKey = !string.IsNullOrEmpty(oSource.Alias) ? oSource.Alias : oSource.Name;
                if (string.Compare(sKey, first, true) == 0)
                {
                    oCurrentSource = oSource;
                    break;
                }
            }
            if (oCurrentSource != null)
            {
                string sSchema = !string.IsNullOrEmpty(oCurrentSource.Schema) ? oCurrentSource.Schema : this.DefaultSchema;
                var    names   = this.InfoProvider.GetColumnsFor(this.DropBrackets(sSchema), this.DropBrackets(oCurrentSource.Name));
                return(CompletionVariantList.Combine(null, names, DataBaseLevel.Columns));
            }
            CompletionVariantList items = null;

            {
                var names = this.InfoProvider.GetColumnsFor(this.DefaultSchema, this.DropBrackets(first));
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Columns);
            }
            {
                var names = this.InfoProvider.GetObjectsInSchema(this.DropBrackets(first));
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Table);
            }
            return(items);
        }
コード例 #3
0
        //=========================================================================================
        CompletionVariantList Get_Variants_For_Items_3(string first, string second, List <SourceInfo> sources)
        {
            SourceInfo oCurrentSource = null;

            foreach (var oSource in sources)
            {
                if (string.IsNullOrEmpty(oSource.Alias) &&
                    string.Compare(oSource.Schema, first, true) == 0 &&
                    string.Compare(oSource.Name, second, true) == 0
                    )
                {
                    oCurrentSource = oSource;
                    break;
                }
            }
            if (oCurrentSource != null)
            {
                return(CompletionVariantList.Combine(null,
                                                     this.InfoProvider.GetColumnsFor(this.DropBrackets(oCurrentSource.Schema), this.DropBrackets(oCurrentSource.Name)),
                                                     DataBaseLevel.Columns));
            }
            else
            {
                return(CompletionVariantList.Combine(null,
                                                     this.InfoProvider.GetColumnsFor(this.DropBrackets(first), this.DropBrackets(second)),
                                                     DataBaseLevel.Columns));
            }
        }
コード例 #4
0
        //=========================================================================================
        public override CompletionVariantList GetVariants()
        {
            CompletionVariantList items = null;
            var names = this.InfoProvider.GetColumnsFor(this.Schema, this.Table);

            items = CompletionVariantList.Combine(items, names, DataBaseLevel.Columns);

            return(items);
        }
コード例 #5
0
        //=========================================================================================
        CompletionVariantList Get_Variants_For_Sources_1()
        {
            CompletionVariantList items = null;

            {
                var names = this.InfoProvider.GetSchemas();
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Schema);
            }
            {
                var names = this.InfoProvider.GetObjectsInSchema(this.DefaultSchema);
                items = CompletionVariantList.Combine(items, names, DataBaseLevel.Table);
            }
            return(items);
        }
コード例 #6
0
        //=========================================================================================
        CompletionVariantList Get_Variants_For_Sources_2(string schema)
        {
            var names = this.InfoProvider.GetObjectsInSchema(this.DropBrackets(schema));

            return(CompletionVariantList.Combine(null, names, DataBaseLevel.Table));
        }