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


C# IContainer.Refresh方法代码示例

本文整理汇总了C#中IContainer.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# IContainer.Refresh方法的具体用法?C# IContainer.Refresh怎么用?C# IContainer.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IContainer的用法示例。


在下文中一共展示了IContainer.Refresh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnInit

        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            _isAuthorizedToConfigure = RockPage.IsAuthorized( "Administrate", CurrentPerson );

            // wire up page naviagte
            RockPage page = Page as RockPage;
            if (page != null)
            {
                page.PageNavigate += page_PageNavigate;
            }

            Type containerType = Type.GetType( GetAttributeValue( "ComponentContainer" ) );
            if ( containerType != null )
            {
                PropertyInfo instanceProperty = containerType.GetProperty( "Instance" );
                if ( instanceProperty != null )
                {
                    _container = instanceProperty.GetValue( null, null ) as IContainer;
                    if ( _container != null )
                    {
                        BindFilter();
                        rFilter.ApplyFilterClick += rFilter_ApplyFilterClick;

                        if ( !Page.IsPostBack )
                            _container.Refresh();

                        rGrid.DataKeyNames = new string[] { "id" };
                        if ( _isAuthorizedToConfigure )
                            rGrid.GridReorder += rGrid_GridReorder;
                        rGrid.Columns[0].Visible = _isAuthorizedToConfigure;    // Reorder
                        rGrid.GridRebind += rGrid_GridRebind;
                        rGrid.RowDataBound += rGrid_RowDataBound;

                        if ( containerType.BaseType.GenericTypeArguments.Length > 0 )
                        {
                            rGrid.RowItemText = containerType.BaseType.GenericTypeArguments[0].Name.SplitCase();
                        }
                    }
                    else
                        DisplayError( "Could not get ContainerManaged instance from Instance property" );
                }
                else
                    DisplayError( "ContainerManaged class does not have an 'Instance' property" );
            }
            else
                DisplayError( "Could not get the type of the specified Manged Component Container" );
        }
开发者ID:pkdevbox,项目名称:Rock,代码行数:49,代码来源:Components.ascx.cs

示例2: OnInit

        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            _isAuthorizedToConfigure = IsUserAuthorized( Authorization.ADMINISTRATE );

            _supportOrdering = GetAttributeValue( "SupportOrdering" ).AsBoolean( true );

            Type containerType = Type.GetType( GetAttributeValue( "ComponentContainer" ) );
            if ( containerType != null )
            {
                PropertyInfo instanceProperty = containerType.GetProperty( "Instance" );
                if ( instanceProperty != null )
                {
                    _container = instanceProperty.GetValue( null, null ) as IContainer;
                    if ( _container != null )
                    {
                        BindFilter();
                        rFilter.ApplyFilterClick += rFilter_ApplyFilterClick;

                        if ( !Page.IsPostBack )
                            _container.Refresh();

                        rGrid.DataKeyNames = new string[] { "Id" };
                        rGrid.Columns[0].Visible = _supportOrdering && _isAuthorizedToConfigure;
                        rGrid.GridReorder += rGrid_GridReorder;
                        rGrid.GridRebind += rGrid_GridRebind;
                        rGrid.RowDataBound += rGrid_RowDataBound;

                        if ( containerType.BaseType.GenericTypeArguments.Length > 0 )
                        {
                            rGrid.RowItemText = containerType.BaseType.GenericTypeArguments[0].Name.SplitCase();
                        }

                        mdEditComponent.SaveClick += mdEditComponent_SaveClick;

                    }
                    else
                        DisplayError( "Could not get ContainerManaged instance from Instance property" );
                }
                else
                    DisplayError( "ContainerManaged class does not have an 'Instance' property" );
            }
            else
                DisplayError( "Could not get the type of the specified Manged Component Container" );
        }
开发者ID:Higherbound,项目名称:Higherbound-2016-website-upgrades,代码行数:46,代码来源:Components.ascx.cs


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