📄 collapsebarcontrolcollection.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web.UI;
namespace CommunityServer.Controls {
internal class CollapseBarControlCollection : System.Web.UI.ControlCollection {
public CollapseBarControlCollection( Control owner ) : base( owner ) {
}
public override void Add( Control child ) {
if ( child is CollapseBarItem ) {
base.Add( child );
return;
}
if ( !( child is System.Web.UI.LiteralControl ) ) {
throw new InvalidOperationException( String.Format( "CollapseBar can only contain controls of type CollapseBarItem. You tried to add a control of type '{0}'", child.GetType().FullName ) );
}
}
public override void AddAt( int index, Control child ) {
if ( child is CollapseBarItem ) {
base.AddAt( index, child );
return;
}
if ( !( child is LiteralControl ) ) {
throw new InvalidOperationException( String.Format( "CollapseBar can only contain controls of type CollapseBarItem. You tried to add a control of type '{0}'", child.GetType().FullName ) );
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -