当前位置: 首页>>代码示例>>C#>>正文


C# DynamicData.MetaColumn类代码示例

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


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


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