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

C# DynamicData.MetaColumn类代码示例

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

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



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

示例1: ChangeValueType

 private static object ChangeValueType(MetaColumn column, string value) {
     if (column.ColumnType == typeof(Guid)) {
         return new Guid(value);
     } else {
         return Convert.ChangeType(value, column.TypeCode, CultureInfo.InvariantCulture);
     }
 }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:7,代码来源:LinqExpressionHelper.cs


示例2: CreateFieldTemplate

        public override IFieldTemplate CreateFieldTemplate(MetaColumn column, DataBoundControlMode mode, string uiHint)
        {
            if (column.IsReadOnly)// code to fix caching issue
                    mode = DataBoundControlMode.ReadOnly;

               return base.CreateFieldTemplate(column, mode, uiHint);
        }
开发者ID:weavver,项目名称:data,代码行数:7,代码来源:SecureFieldTemplateFactory.cs


示例3: IsShown

    //-------------------------------------------------------------------------------------------
    public static Boolean IsShown(MetaColumn column)
    {
        // need to get the current page template
          var page = (System.Web.UI.Page)System.Web.HttpContext.Current.CurrentHandler;
          var pageTemplate = page.GetPageTemplate();

          var hideIn = column.GetAttribute<HideColumnInAttribute>();
          if (hideIn != null && (hideIn.PageTemplates.Contains(pageTemplate)))
               return false;

          var hideIfFiltered = column.GetAttribute<HideIfFiltered>();
          if (hideIfFiltered != null &&
               (System.Web.HttpContext.Current.Request[column.Name] != null ||
                    (hideIfFiltered.FilterName != null &&
                     System.Web.HttpContext.Current.Request[hideIfFiltered.FilterName] != null))
               )
               return false;

          var securedColumns = column.GetColumnPermissions(System.Web.Security.Roles.GetRolesForUser());
          if (securedColumns.Contains(ColumnActions.DenyRead))
               return false;

          //foreach (var secureColumn in securedColumns)
          //{
          //     if (securedColumn
          //}

          return true;
    }
开发者ID:weavver,项目名称:weavver,代码行数:30,代码来源:Global.asax.cs


示例4: CreateTextTemplate

        public static SimpleFieldTemplateUserControl CreateTextTemplate(MetaColumn column, bool readOnly) {
            SimpleFieldTemplateUserControl control = new SimpleFieldTemplateUserControl();
            if (readOnly) {
                var literal = new Literal();
                literal.DataBinding += (sender, e) => {
                    literal.Text = control.FieldValueString;
                };
                control.Controls.Add(literal);
            }
            else {
                var textBox = new TextBox();                
                textBox.DataBinding += (sender, e) => {                    
                    textBox.Text = control.FieldValueEditString;                    
                };
                // Logic copied from BoundField
                if (column.ColumnType.IsPrimitive) {
                    textBox.Columns = 5;
                }
                control._valueExtrator = () => textBox.Text;
                textBox.CssClass = "DDTextBox";
                textBox.ID = TextBoxID;
                control.Controls.Add(textBox);
                control.CreateValidators(column);
            }

            return control;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:27,代码来源:SimpleFieldTemplateUserControl.cs


示例5: IsAuthorized

    //-------------------------------------------------------------------------------------------
    public static Boolean IsAuthorized(MetaColumn column)
    {
        var securedColumns = column.GetColumnPermissions(System.Web.Security.Roles.GetRolesForUser());
          if (securedColumns.Contains(ColumnActions.DenyRead))
               return false;

          return true;
    }
开发者ID:weavver,项目名称:weavver,代码行数:9,代码来源:Global.asax.cs


示例6: GetFilterVirtualPathWithCaching

        // internal for unit testing
        internal string GetFilterVirtualPathWithCaching(MetaColumn column, string filterUIHint) {
            Debug.Assert(column != null);
            long cacheKey = Misc.CombineHashCodes(column, filterUIHint);

            return _templateFactory.GetTemplatePath(cacheKey, delegate() {
                return GetFilterVirtualPath(column, filterUIHint);
            });
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:FilterFactory.cs


示例7: OnLoad

 protected override void OnLoad(EventArgs e) {
     foreach (MetaColumn column in Table.GetScaffoldColumns(Mode, ContainerType)) {
         currentColumn = column;
         Control item = new DefaultEntityTemplate._NamingContainer();
         EntityTemplate1.ItemTemplate.InstantiateIn(item);
         EntityTemplate1.Controls.Add(item);
     }
 }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:8,代码来源:Default_Insert.ascx.cs


示例8: IncludeField

        private bool IncludeField(MetaColumn column, DataBoundControlMode mode) {

            // Exclude bool columns in Insert mode (just to test custom filtering)
            if (mode == DataBoundControlMode.Insert && column.ColumnType == typeof(bool))
                return false;

            return true;
        }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:8,代码来源:CustomMetaTable.cs


示例9: CreateFieldTemplate

 private IFieldTemplate CreateFieldTemplate(bool readOnly, MetaColumn column) {
     // By default we'll support checkbox fields for boolean and a textbox for
     // everything else
     if (column.ColumnType == typeof(bool)) {
         return SimpleFieldTemplateUserControl.CreateBooleanTemplate(readOnly);
     }
     return SimpleFieldTemplateUserControl.CreateTextTemplate(column, readOnly);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:SimpleFieldTemplateFactory.cs


示例10: GetFilterVirtualPath

        public virtual string GetFilterVirtualPath(MetaColumn column, string filterUIHint) {
            if (column == null) {
                throw new ArgumentNullException("column");
            }

            string filterControlName = BuildFilterVirtualPath(column, filterUIHint);
            string filterTemplatePath = VirtualPathUtility.Combine(FilterFolderVirtualPath, filterControlName + ".ascx");
            return filterTemplatePath;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:FilterFactory.cs


示例11: SetParameterTypeCodeAndDbType

 internal static void SetParameterTypeCodeAndDbType(Parameter parameter, MetaColumn column) {
     // If it's a Guid, use a DbType, since TypeCode doesn't support it.  For everything else, use TypeCode
     if (column.ColumnType == typeof(Guid)) {
         parameter.DbType = DbType.Guid;
     }
     else {
         parameter.Type = column.TypeCode;
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:9,代码来源:DataSourceUtil.cs


示例12: IsHidden

        private static Boolean IsHidden(MetaColumn column)
        {
            var browsable = column.Attributes.OfType<BrowsableAttribute>().SingleOrDefault();

            if (browsable == null)
            {
                return false;
            }

            return !browsable.Browsable;
        }
开发者ID:jorik041,项目名称:X.DynamicData,代码行数:11,代码来源:HideColumnFieldsManager.cs


示例13: CreateField

        protected virtual DynamicField CreateField(MetaColumn column, ContainerType containerType, DataBoundControlMode mode) {            
            string headerText = (containerType == ContainerType.List ? column.ShortDisplayName : column.DisplayName);

            var field = new DynamicField() {
                DataField = column.Name,
                HeaderText = headerText
            };
            // Turn wrapping off by default so that error messages don't show up on the next line.
            field.ItemStyle.Wrap = false;

            return field;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:DefaultAutoFieldGenerator.cs


示例14: CreateFilterControl

        public virtual QueryableFilterUserControl CreateFilterControl(MetaColumn column, string filterUIHint) {
            if (column == null) {
                throw new ArgumentNullException("column");
            }
            string filterTemplatePath = GetFilterVirtualPathWithCaching(column, filterUIHint);
            Debug.Assert(filterTemplatePath != null);

            QueryableFilterUserControl filter = (QueryableFilterUserControl)BuildManager.CreateInstanceFromVirtualPath(
                filterTemplatePath, typeof(QueryableFilterUserControl));

            return filter;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:FilterFactory.cs


示例15: GetDefaultFilterControlName

 private string GetDefaultFilterControlName(MetaColumn column) {
     if (column is MetaForeignKeyColumn) {
         return s_foreignKeyFilter;
     }
     else if (column.ColumnType == typeof(bool)) {
         return s_booleanFilter;
     }
     else if (column.GetEnumType() != null) {
         return s_enumerationFilter;
     }
     else {
         throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture,
             Resources.DynamicDataResources.FilterFactory_ColumnHasNoDefaultFilter,
             column.Name,
             column.Table.Name));
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:17,代码来源:FilterFactory.cs


示例16: GetPropertyControlWhereParameters

        private IEnumerable<Parameter> GetPropertyControlWhereParameters(Control control,
            IControlParameterTarget paramTarget, MetaColumn column) {
            ControlParameter controlParameter = new ControlParameter() {
                Name = column.Name,
                ControlID = control.UniqueID,
                PropertyName = paramTarget.GetPropertyNameExpression(column.Name)
            };
            
            DataSourceUtil.SetParameterTypeCodeAndDbType(controlParameter, column);

            yield return controlParameter;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:DynamicControlParameter.cs


示例17: DynamicFieldErrors

        // Dynamic field errors based on entity + column

        public static string DynamicFieldErrors(this HtmlHelper html, object entity, MetaColumn column) {
            return DynamicFieldErrors(html, entity, column.Name);
        }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:5,代码来源:DynamicFieldErrorsExtensions.cs


示例18: ColumnTypeToSpecialName

		string ColumnTypeToSpecialName (Type columnType, MetaColumn column, DataBoundControlMode mode)
		{
			if (columnType == typeof (int))
				return GetExistingTemplateVirtualPath ("Integer", column, mode);

			if (columnType == typeof (string))
				return GetExistingTemplateVirtualPath ("Text", column, mode);
			
			return null;
		}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:FieldTemplateFactory.cs


示例19: BuildFilterVirtualPath

        private string BuildFilterVirtualPath(MetaColumn column, string filterUIHint) {
            string filterControlName = null;
            if (!String.IsNullOrEmpty(filterUIHint)) {
                filterControlName = filterUIHint;
            }
            else if (!String.IsNullOrEmpty(column.FilterUIHint)) {
                filterControlName = column.FilterUIHint;
            }

            filterControlName = filterControlName ?? GetDefaultFilterControlName(column);
            return filterControlName;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:FilterFactory.cs


示例20: DynamicFieldTitle

 // Dynamic field titles based on entity + column
 public static string DynamicFieldTitle(this HtmlHelper html, object entity, MetaColumn column)
 {
     return column.DisplayName;
 }
开发者ID:JoeyCyril,项目名称:BoC,代码行数:5,代码来源:DynamicFieldTitleExtensions.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# DynamicData.MetaTable类代码示例发布时间:2022-05-26
下一篇:
C# DynamicData.DynamicDataManager类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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