/// <summary>
        ///     LUA结构支持
        /// </summary>
        /// <returns></returns>
        public virtual void GetLuaStruct(StringBuilder code)
        {
            if (!string.IsNullOrWhiteSpace(Name))
            {
                code.AppendLine($@"['Name'] = '{Name.ToLuaString()}',");
            }

            if (!string.IsNullOrWhiteSpace(Caption))
            {
                code.AppendLine($@"['Caption'] = ""{Caption.ToLuaString()}"",");
            }

            if (!string.IsNullOrWhiteSpace(Description))
            {
                code.AppendLine($@"['Description'] = '{Description.ToLuaString()}',");
            }

            code.AppendLine($@"['IsReference'] = {IsReference.ToString().ToLower()},");

            code.AppendLine($@"['Key'] = '{Key}',");

            code.AppendLine($@"['Identity'] = {Identity},");

            code.AppendLine($@"['Index'] = {Index},");

            //code.AppendLine($@"['Discard'] = {(Discard.ToString().ToLower())},");

            //code.AppendLine($@"['IsFreeze'] = {(IsFreeze.ToString().ToLower())},");

            //code.AppendLine($@"['IsDelete'] = {(IsDelete.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(Tag))
            {
                code.AppendLine($@"['Tag'] = '{Tag.ToLuaString()}',");
            }

            //if (!string.IsNullOrWhiteSpace(NameHistory))
            //    code.AppendLine($@"['NameHistory'] = ""{NameHistory.ToLuaString()}"",");

            //int idx = 0;
            //code.Append("'OldNames':'{");
            //foreach (var val in OldNames)
            //    code.AppendLine($@"{++idx}:{val.GetLuaStruct()},");
        }
Exemple #2
0
        /// <summary>
        /// Returns a list of all databases from the required provider
        /// </summary>
        /// <param name="dbType">Provider Db type</param>
        /// <param name="reference">Is the requested database a reference database</param>
        /// <returns>Collection of all databases from the required provider</returns>
        public IEnumerable <DbInfoModel> GetAllDbByType(string dbType, IsReference reference)
        {
            string str = reference.ToString();

            return(_db.ExecuteQuery <DbInfoModel>(_request.GetAllDbByTypeRequest(_db.TableName, dbType, str)));
        }