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


C# DynamicData.MetaTable类代码示例

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


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

示例1: FieldGenerator

        // Methods
        public FieldGenerator( MetaTable table, Control dataBoundControl, DataBoundControlMode mode )
        {
            this._table = table;
            this._dataBoundControl = dataBoundControl;
            this._mode = mode;

            List<MetaColumn> columns = new List<MetaColumn>( _table.Columns );

            //упорядочить колонки в порядке следования в мета-классе.
            var metadataTypeAttribute = (MetadataTypeAttribute)Attribute.GetCustomAttribute( _table.EntityType, typeof( MetadataTypeAttribute ), false );
            if( metadataTypeAttribute != null )
            {
                int index = 0;
                foreach( var memberInfo in metadataTypeAttribute.MetadataClassType.GetMembers().Where( m => m.MemberType == MemberTypes.Field || m.MemberType == MemberTypes.Property ) )
                {
                    int pos = columns.FindIndex( c => c.Name == memberInfo.Name );
                    if( pos >= 0 )
                    {
                        MetaColumn column = columns[ pos ];
                        columns.RemoveAt( pos );
                        columns.Insert( index++, column );
                    }
                }
            }
            _columns = columns;
        }
开发者ID:dmziryanov,项目名称:ApecAuto,代码行数:27,代码来源:FieldGenerator.cs

示例2: GetEntityTemplateVirtualPathWithCaching

        private string GetEntityTemplateVirtualPathWithCaching(MetaTable table, DataBoundControlMode mode, string uiHint) {
            long cacheKey = Misc.CombineHashCodes(table, mode, uiHint);

            return _factory.GetTemplatePath(cacheKey, delegate() {
                return GetEntityTemplateVirtualPath(table, mode, uiHint);
            });
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:EntityTemplateFactory.cs

示例3: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            this.table = DynamicDataRouteHandler.GetRequestMetaTable(this.Context);

            this.FormView1.SetMetaTable(this.table);
            this.DetailsDataSource.ContextTypeName = this.table.DataContextType.FullName;
        }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:7,代码来源:Edit.aspx.cs

示例4: AreEntitiesEqual

        private static bool AreEntitiesEqual(MetaTable table, object entity1, object entity2)
        {
            var pks1 = table.GetPrimaryKeyValues(entity1);
            var pks2 = table.GetPrimaryKeyValues(entity2);

            return pks1.SequenceEqual(pks2);
        }
开发者ID:NuGetPrototypes,项目名称:NuGetGallery,代码行数:7,代码来源:ManyToMany_Edit.ascx.cs

示例5: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
            GridDataSource.EntityTypeFilter = table.EntityType.Name;

            // Set the search data fields to all the string columns
            var searchExpression = (SearchExpression)GridQueryExtender.Expressions[1];
            searchExpression.DataFields = String.Join(",", table.Columns.Where(c => c.IsString).Select(c => c.Name));
            if (String.IsNullOrEmpty(searchExpression.DataFields))
            {
                // No string fields, remove the search elements
                SearchPanel.Visible = false;
                GridQueryExtender.Expressions.Remove(searchExpression);
            }

            // Disable various options if the table is readonly
            GridView1.ColumnsGenerator = new OrderedFieldGenerator(table);
            if (table.IsReadOnly)
            {
                GridView1.Columns[0].Visible = false;
                InsertHyperLink.Visible = false;
                GridView1.EnablePersistedSelection = false;
            }
        }
开发者ID:henrycomein,项目名称:NuGetGallery,代码行数:25,代码来源:List.aspx.cs

示例6: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
            GridDataSource.EntityTypeFilter = table.EntityType.Name;

        }
开发者ID:50minutos,项目名称:ATENTO-ASP.NET,代码行数:7,代码来源:List.aspx.cs

示例7: Page_Load

        //-------------------------------------------------------------------------------------------
        protected void Page_Load(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);

               WeavverMaster.SetChatVisibility(true);
               WeavverMaster.FixedWidth = false;
               WeavverMaster.Width = "100%";
               WeavverMaster.FormTitle = table.DisplayName;
               WeavverMaster.FormDescription = GetPageContent("Logistics/Products/Showcase_Description");

               //GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
               //GridView1.RowCreated += new GridViewRowEventHandler(GridView1_RowCreated);
               GridDataSource.EntityTypeFilter = table.EntityType.Name;

               if (table.EntityType.FullName.Contains("Logistics_Products"))
               {
                    if (LoggedInUser == null || LoggedInUser.OrganizationId != SelectedOrganization.OrganizationId)
                    {
                         GridDataSource.WhereParameters.Add(new Parameter("IsPublic", DbType.Boolean, "True"));
                    }
               }
               GridDataSource.WhereParameters.Add(new Parameter("OrganizationId", DbType.Guid, SelectedOrganization.Id.ToString()));

               GridDataSource.OrderBy = "it.Name";

               WeavverMaster.FormTitle = table.DisplayName;
               GridDataSource.Include = table.ForeignKeyColumnsNames;

               StoreSpecials.Text = GetPageContent("Sales/Store Specials");
        }
开发者ID:weavver,项目名称:weavver,代码行数:31,代码来源:Showcase.aspx.cs

示例8: Page_Init

        //-------------------------------------------------------------------------------------------
        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);

               //GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
               //GridView1.RowCreated += new GridViewRowEventHandler(GridView1_RowCreated);
               GridDataSource.EntityTypeFilter = table.EntityType.Name;

               // HACKED TOGETHER FOR NOW
               if (User.Identity.IsAuthenticated)
               {
                    GridDataSource.WhereParameters.Add(new Parameter("OrganizationId", DbType.Guid, LoggedInUser.OrganizationId.ToString()));
               }
               else
               {
                    GridDataSource.WhereParameters.Add(new Parameter("OrganizationId", DbType.Guid, "0baae579-dbd8-488d-9e51-dd4dd6079e95"));
               }

               GridDataSource.OrderBy = "it.PublishAt desc";

               Master.FixedWidth = true;
               Master.FormTitle = table.DisplayName;
               IsPublic = true;

               //Master.FormTitle = "Professional Services";
               Master.FormDescription = "If you need help or would like to discuss a custom project please call us at +1-714-872-5920.";

               if (Roles.IsUserInRole("Administrators"))
                    AdminLinks.Visible = true;
        }
开发者ID:weavver,项目名称:weavver,代码行数:31,代码来源:PressRoll.aspx.cs

示例9: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));

            DetailsDataSource.DomainServiceTypeName = table.DataContextType.AssemblyQualifiedName;
            DetailsDataSource.QueryName = table.GetSelectMethod();
        }
开发者ID:davidebbo-test,项目名称:DomainServiceDynamicData,代码行数:8,代码来源:Insert.aspx.cs

示例10: BuildSingleItemQuery

        public static MethodCallExpression BuildSingleItemQuery(IQueryable query, MetaTable metaTable, string[] primaryKeyValues) {
            // Items.Where(row => row.ID == 1)
            var whereCall = BuildItemsQuery(query, metaTable, metaTable.PrimaryKeyColumns, primaryKeyValues);
            // Items.Where(row => row.ID == 1).Single()
            var singleCall = Expression.Call(typeof(Queryable), "Single", new Type[] { metaTable.EntityType }, whereCall);

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

示例11: Page_Init

 protected void Page_Init(object sender, EventArgs e) {
     table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
     GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
     GridDataSource.EntityTypeName = table.EntityType.AssemblyQualifiedName;
     if (table.EntityType != table.RootEntityType) {
         GridQueryExtender.Expressions.Add(new OfTypeExpression(table.EntityType));
     }
 }
开发者ID:roysalor,项目名称:Curso-ASP.NET,代码行数:8,代码来源:List.aspx.cs

示例12: AdvancedFieldGenerator

        /// <summary>
        /// Creates a new AdvancedFieldGenerator.
        /// </summary>
        /// <param name="table">The table this class generates fields for.</param>
        /// <param name="multiItemMode"><value>true</value> to indicate a multi-item control such as GridView, <value>false</value> for a single-item control such as DetailsView.</param>
        public AdvancedFieldGenerator(MetaTable table, bool multiItemMode) {
            if (table == null) {
                throw new ArgumentNullException("table");
            }

            _table = table;
            _containerType = multiItemMode ? ContainerType.List : ContainerType.Item;
            SkipList = new List<MetaColumn>();
        }
开发者ID:sanyaade-mobiledev,项目名称:ASP.NET-Mvc-2,代码行数:14,代码来源:AdvancedFieldGenerator.cs

示例13: Page_Init

 protected void Page_Init(object sender, EventArgs e)
 {
     table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
     DetailsView1.SetMetaTable(table);
     DetailsDataSource.EntityTypeFilter = table.EntityType.Name;
     DetailsView1.RowsGenerator = new OrderedFieldGenerator(table);
     Title = table.DisplayName;
     DetailsDataSource.Include = table.ForeignKeyColumnsNames;
 }
开发者ID:henrycomein,项目名称:NuGetGallery,代码行数:9,代码来源:Edit.aspx.cs

示例14: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            FormView1.SetMetaTable(table);

            DetailsDataSource.DomainServiceTypeName = table.DataContextType.AssemblyQualifiedName;
            DetailsDataSource.QueryName = table.GetSelectMethod();
            FormView1.DataKeyNames = table.PrimaryKeyColumns.Select(c => c.Name).ToArray();
        }
开发者ID:davidebbo-test,项目名称:DomainServiceDynamicData,代码行数:9,代码来源:Details.aspx.cs

示例15: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            FormView1.SetMetaTable(table);
            DetailsDataSource.EntityTypeFilter = table.EntityType.Name;

            DetailsDataSource.ContextCreating += (o, args) =>
            {
                args.Context = (ObjectContext)table.CreateContext();
            };
        }
开发者ID:ZhiYuanHuang,项目名称:NuGetGallery,代码行数:11,代码来源:Edit.aspx.cs


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