本文整理汇总了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" );
}
示例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" );
}