• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IColumn类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IColumn的典型用法代码示例。如果您正苦于以下问题:C# IColumn类的具体用法?C# IColumn怎么用?C# IColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IColumn类属于命名空间,在下文中一共展示了IColumn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BuildAlterColumnStatement

 public override string BuildAlterColumnStatement(IColumn column)
 {
     //SQLite doesn't support altering columns. There is no typing either, or length considerations
     //so - unless we're adding/dropping, fuggedaboutit
     //http://stackoverflow.com/questions/623044/how-to-alter-sqlite-column-iphone
     return "";
 }
开发者ID:6nop,项目名称:SubSonic-3.0,代码行数:7,代码来源:SQLiteSchema.cs


示例2: AddColumn

 public string AddColumn(IColumn column) {
     var sql = new StringBuilder("alter table ");
     this.dialect.AppendQuotedTableName(sql, column.Map);
     sql.Append(" add ");
     this.dialect.AppendColumnSpecification(sql, column);
     return sql.ToString();
 }
开发者ID:Polylytics,项目名称:dashing,代码行数:7,代码来源:AlterTableWriter.cs


示例3: ModifyColumn

        public override string ModifyColumn(IColumn fromColumn, IColumn toColumn) {
            var sql = new StringBuilder();

            // drop a column constraint if need be
            if (!string.IsNullOrEmpty(fromColumn.Default) && !fromColumn.IsPrimaryKey && !fromColumn.IsAutoGenerated
                && (string.IsNullOrEmpty(toColumn.Default) || fromColumn.Default != toColumn.Default)) {
                sql.AppendLine(this.OnBeforeDropColumn(fromColumn));
            }

            // alter the column
            sql.Append("alter table ");
            this.AppendQuotedTableName(sql, toColumn.Map);
            sql.Append(" alter column ");
            this.AppendColumnSpecification(sql, toColumn, false);

            // add a column constraint if need be
            if (!string.IsNullOrEmpty(toColumn.Default) && !toColumn.IsPrimaryKey && !toColumn.IsAutoGenerated) {
                sql.AppendLine(";");
                sql.Append("alter table ");
                this.AppendQuotedTableName(sql, toColumn.Map);
                sql.Append(" add default (");
                sql.Append(toColumn.Default);
                sql.Append(") for");
                this.AppendQuotedName(sql, toColumn.DbName);
            }

            return sql.ToString();
        }
开发者ID:Polylytics,项目名称:dashing,代码行数:28,代码来源:SqlServerDialect.cs


示例4: To

        public void To(IColumn column)
        {
            RemoveOldMapping();

            if (column == null)
            {
                ms.InvalidateCache();
                return;
            }

            var mapping = ms.GetMappingFor(property.Component);

            if (mapping == null)
            {
                mapping = new ComponentMappingImpl();
                mapping.ToComponent = property.Component;
                mapping.FromTable = column.Parent;
                mapping.AddPropertyAndColumn(property, column);

                ms.AddMapping(mapping);
            }
            else
            {
                mapping.SetMapping(property, column);
                ms.InvalidateCache();
            }
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:27,代码来源:FluentInterfaces.cs


示例5: GetUnobtrusiveValidationAttributes

        public static IDictionary<string, object> GetUnobtrusiveValidationAttributes(IColumn column)
        {
            Dictionary<string, object> resultsDictionary = new Dictionary<string, object>();

            string fullHtmlFieldName = column.Name;

            IEnumerable<ModelClientValidationRule> enumerable = GetClientValidationRule(column);
            bool flag = false;
            foreach (ModelClientValidationRule rule in enumerable)
            {
                flag = true;
                string dictionaryKey = "data-val-" + rule.ValidationType;
                //ValidateUnobtrusiveValidationRule(rule, resultsDictionary, dictionaryKey);
                resultsDictionary[dictionaryKey] = HttpUtility.HtmlEncode(rule.ErrorMessage ?? string.Empty);
                dictionaryKey = dictionaryKey + "-";
                foreach (KeyValuePair<string, object> pair in rule.ValidationParameters)
                {
                    resultsDictionary[dictionaryKey + pair.Key] = pair.Value.ToString() ?? string.Empty;
                }
            }
            if (flag)
            {
                resultsDictionary.Add("data-val", "true");
            }

            return resultsDictionary;
        }
开发者ID:jason1234,项目名称:CMS,代码行数:27,代码来源:ValidationExtensions.cs


示例6: SetMappedColumn

 public static void SetMappedColumn(this ComponentPropertyMarker property, IColumn column)
 {
     if (property == null) throw new ArgumentNullException("property");
     var set = property.GetMappingSet();
     if (set == null) throw new Exception(string.Format("Could not set Mapped Column for Property {0}: Could not get its MappingSet", property.PropertyName));
     set.ChangeMappingFor(property).To(column);
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:EntityLayerExtensions.cs


示例7: GetClientValidationRule

        private static IEnumerable<ModelClientValidationRule> GetClientValidationRule(IColumn column)
        {
            if (column.DataType == DataType.Int || column.DataType == DataType.Decimal)
            {
                yield return new ModelClientValidationRule()
                     {
                         ValidationType = "number",
                         ErrorMessage = string.Format(SR.GetString("ClientDataTypeModelValidatorProvider_FieldMustBeNumeric"), column.Name)
                     };
            }
            if (column.DataType == DataType.String && column.Length > 0)
            {
                yield return new ModelClientValidationStringLengthRule(string.Format(SR.GetString("StringLengthAttribute_ValidationError"), column.Name, column.Length)
                    , 0, column.Length);
            }
            if (!column.AllowNull)
            {
                yield return new ModelClientValidationRequiredRule(string.Format(SR.GetString("RequiredAttribute_ValidationError"), column.Name));
            }
            if (column.Validations != null)
            {
                foreach (var validation in column.Validations)
                {
                    foreach (var clientValidation in validation.GetClientValidationRule(column.Name))
                    {
                        yield return clientValidation;
                    }
                }
            }

        }
开发者ID:Godoy,项目名称:CMS,代码行数:31,代码来源:ValidationExtensions.cs


示例8: BuildAddColumnStatement

        /// <summary>
        /// Adds the column.
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="column">The column.</param>
        /// <returns></returns>
        public virtual string BuildAddColumnStatement(string tableName, IColumn column)
        {
            var sql = new StringBuilder();

            //if we're adding a Non-null column to the DB schema, there has to be a default value
            //otherwise it will result in an error'
            if (!column.IsNullable && column.DefaultSetting == null)
            {
                SetColumnDefaults(column);
            }

            sql.AppendFormat(ADD_COLUMN, tableName, column.Name, GenerateColumnAttributes(column));
            
            //if the column isn't nullable and there are records already
            //the default setting won't be honored and a null value could be entered (in SQLite for instance)
            //enforce the default setting here
            if(!column.IsNullable)
            {
                sql.AppendLine();

                var defaultValue = column.DefaultSetting;

                if (column.IsString || column.IsDateTime)
                {
                    defaultValue = String.Format("'{0}'", column.DefaultSetting);
                }

                sql.AppendFormat(UPDATE_DEFAULTS, tableName, column.Name, defaultValue);
            }
            
            return sql.ToString();
        }
开发者ID:alonsorobles,项目名称:SubSonic-3.0,代码行数:38,代码来源:ANSISchemaGenerator.cs


示例9: AppendColumnSpecificationWithoutName

        protected void AppendColumnSpecificationWithoutName(StringBuilder sql, IColumn column, bool scriptDefault = true) {
            sql.Append(this.TypeName(column.DbType));

            if (column.DbType.TypeTakesLength()) {
                sql.Append("(");
                if (column.MaxLength) {
                    sql.Append("max");
                }
                else {
                    sql.Append(column.Length);
                }

                sql.Append(")");
            }

            if (column.DbType.TypeTakesPrecisionAndScale()) {
                this.AppendPrecisionAndScale(sql, column.Precision, column.Scale);
            }

            sql.Append(column.IsNullable ? " null" : " not null");

            if (scriptDefault && !string.IsNullOrEmpty(column.Default) && !column.IsPrimaryKey && !column.IsAutoGenerated) {
                this.AppendDefault(sql, column);
            }

            if (column.IsAutoGenerated) {
                this.AppendAutoGenerateModifier(sql, column);
            }

            if (column.IsPrimaryKey) {
                sql.Append(" primary key");
            }
        }
开发者ID:Polylytics,项目名称:dashing,代码行数:33,代码来源:SqlDialectBase.cs


示例10: RenderInput

        protected override string RenderInput(IColumn column)
        {
            StringBuilder sb = new StringBuilder(string.Format(@"@{{ var radioDefaultValue_{0} = @""{1}"";}}", column.Name, column.DefaultValue.EscapeQuote()));
            if (!string.IsNullOrEmpty(column.SelectionFolder))
            {
                sb.AppendFormat(@"
                        @{{
                            var textFolder_{0} = new TextFolder(Repository.Current, ""{1}"");
                            var query_{0} = textFolder_{0}.CreateQuery().DefaultOrder();
                        }}
                        @foreach (var item in query_{0})
                        {{
                           <input id=""{0}"" name=""{0}"" type=""radio"" value=""@item.UUID""  @((Model.{0} != null && Model.{0}.ToString().ToLower() == @item.UUID.ToLower()) || (Model.{0} == null && radioDefaultValue_{0}.ToLower() == @item.UUID.ToLower()) ? ""checked"" : """")/><label for=""{0}"">@item.GetSummary()</label>
                        }}
                        ", column.Name, column.SelectionFolder);
            }
            else
            {

                if (column.SelectionItems != null)
                {
                    var index = 0;
                    foreach (var item in column.SelectionItems)
                    {
                        var id = column.Name + "_" + index.ToString();
                        index++;
                        sb.AppendFormat(@"
            <input id=""{0}"" name=""{1}"" type=""radio"" value=""@(@""{2}"")""  @((Model.{1} != null && Model.{1}.ToString().ToLower() == @""{2}"".ToLower()) || (Model.{1} == null && radioDefaultValue_{1}.ToLower() == @""{2}"".ToLower()) ? ""checked"" : """")/><label for=""{0}"">{3}</label>"
                            , id, column.Name, item.Value.EscapeQuote(), item.Text);
                    }
                }

            }
            return sb.ToString();
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:35,代码来源:RadioList.cs


示例11: ModifyColumn

 public override string ModifyColumn(IColumn fromColumn, IColumn toColumn) {
     var sql = new StringBuilder("alter table ");
     this.AppendQuotedTableName(sql, toColumn.Map);
     sql.Append(" modify column ");
     this.AppendColumnSpecification(sql, toColumn);
     return sql.ToString();
 }
开发者ID:gitter-badger,项目名称:dashing,代码行数:7,代码来源:MySqlDialect.cs


示例12: RenderColumnHeader

		void RenderColumnHeader(IColumn c, Painter p, Node n)
		{
			p.SetPosition(c.Left);
			if (c.Left > 0)
				p.DrawSeparatorLine(Pens.Black);
			p.Pad(4);
			p.DrawString(c.Name, Font, Brushes.Black, 3, c.Left + c.Width);
		}
开发者ID:chrisforbes,项目名称:Ijw.Framework,代码行数:8,代码来源:TreeColumnHeader.cs


示例13: DateTimeProperty

 public DateTimeProperty(string displayname, IColumn column)
 {
     Type = FilterType.DateTime;
     //            DisplayPrefix = "txt";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.IsLarger, OperatorType.IsLargerOrEqual, OperatorType.IsSmaller, OperatorType.IsSmallerOrEqual };
 }
开发者ID:NLADP,项目名称:ADF,代码行数:8,代码来源:TextProperty.cs


示例14: Render

        public override string Render(ISchema schema, IColumn column)
        {
            string html = string.Format(CheckBoxTemplate, column.Name,
                 (string.IsNullOrEmpty(column.Label) ? column.Name : column.Label).RazorHtmlEncode(), RenderInput(column),
                 FormHelper.Tooltip(column.Tooltip));

            return html;
        }
开发者ID:kooboo-jifeng,项目名称:CMS,代码行数:8,代码来源:CheckBox.cs


示例15: AppendAutoGenerateModifier

 protected override void AppendAutoGenerateModifier(StringBuilder sql, IColumn column) {
     if (column.Type == typeof(Guid)) {
         sql.Append(" NEWSEQUENTIALID()");
     }
     else {
         sql.Append(" identity(1,1)");
     }
 }
开发者ID:Polylytics,项目名称:dashing,代码行数:8,代码来源:SqlServerDialect.cs


示例16: TextProperty

 public TextProperty(string displayname, IColumn column)
 {
     Type = FilterType.Text;
     //            DisplayPrefix = "txt";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.Like, OperatorType.IsNotEqualOrIsNull };
 }
开发者ID:erwinbovendeur,项目名称:ADF,代码行数:8,代码来源:TextProperty.cs


示例17: NumericProperty

 public NumericProperty(string displayname, IColumn column)
 {
     Type = FilterType.Number;
     //            DisplayPrefix = "txt";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual, OperatorType.IsLarger, OperatorType.IsLargerOrEqual, OperatorType.IsSmaller, OperatorType.IsSmallerOrEqual, OperatorType.IsNotEqualOrIsNull };
 }
开发者ID:erwinbovendeur,项目名称:ADF,代码行数:8,代码来源:TextProperty.cs


示例18: RemoveColumn

 public void RemoveColumn(IColumn column)
 {
     if (!(column is GridViewColumnWrapper))
         throw new Exception("Only GridViewColumnWrapper are allowed.");
     var gridViewColumnWrapper = (GridViewColumnWrapper)column;
     if (!_extendedGridView.RemoveColumn(gridViewColumnWrapper.GridViewColumn))
         throw new Exception("The given GridViewColumnWrapper was not an element of the collection.");
 }
开发者ID:Bruhankovi4,项目名称:Emotyper,代码行数:8,代码来源:GridViewTable.cs


示例19: BooleanProperty

 public BooleanProperty(string displayname, IColumn column)
 {
     Type = FilterType.Boolean;
     //            DisplayPrefix = "cbx";
     DisplayName = ResourceManager.GetString(displayname);
     Column = column;
     Operators = new[] { OperatorType.IsEqual };
 }
开发者ID:NLADP,项目名称:ADF,代码行数:8,代码来源:TextProperty.cs


示例20: QualifyColumnName

        public override string QualifyColumnName(IColumn column)
        {
            string qualifiedFormat;

            qualifiedFormat = String.IsNullOrEmpty(column.SchemaName) ? "`{2}`" : "`{0}`.`{1}`.`{2}`";
        
            return String.Format(qualifiedFormat, column.Table.SchemaName, column.Table.Name, column.Name);
        }
开发者ID:rally25rs,项目名称:SubSonic-3.0,代码行数:8,代码来源:MySQLProvider.cs



注:本文中的IColumn类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IColumnInfo类代码示例发布时间:2022-05-24
下一篇:
C# IColorType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap