📄 toolbarcollection.cs
字号:
namespace FreeTextBoxControls.Support
{
using FreeTextBoxControls;
using System;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Web;
using System.Web.UI;
public class ToolbarCollection : ICollection, IEnumerable, IStateManager
{
internal ToolbarCollection()
{
this.toolbars = new ArrayList();
}
public int Add(Toolbar item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
return this.toolbars.Add(item);
}
public void Clear()
{
this.toolbars.Clear();
}
public bool Contains(Toolbar item)
{
if (item == null)
{
return false;
}
return this.toolbars.Contains(item);
}
public void CopyTo(Array array, int index)
{
this.toolbars.CopyTo(array, index);
}
public IEnumerator GetEnumerator()
{
return this.toolbars.GetEnumerator();
}
public int IndexOf(Toolbar item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
return this.toolbars.IndexOf(item);
}
public void Insert(int index, Toolbar item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
this.toolbars.Insert(index, item);
}
public void Remove(Toolbar item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
this.toolbars.Remove(item);
}
public void RemoveAt(int index)
{
this.toolbars.RemoveAt(index);
}
void IStateManager.LoadViewState(object savedState)
{
HttpContext.Current.Trace.Write("ToolbarCollection", "Loading ViewState");
if (savedState != null)
{
object[] objArray1 = (object[]) savedState;
this.toolbars = new ArrayList(objArray1.Length);
for (int num1 = 0; num1 < objArray1.Length; num1++)
{
Toolbar toolbar1 = new Toolbar();
((IStateManager) toolbar1).TrackViewState();
this.toolbars.Add(toolbar1);
if (objArray1[num1] != null)
{
((IStateManager) this.toolbars[num1]).LoadViewState(objArray1[num1]);
}
}
}
}
object IStateManager.SaveViewState()
{
HttpContext.Current.Trace.Write("ToolbarCollection", "Save");
bool flag1 = true;
object[] objArray1 = new object[this.toolbars.Count];
for (int num1 = 0; num1 < this.toolbars.Count; num1++)
{
objArray1[num1] = ((IStateManager) this.toolbars[num1]).SaveViewState();
if (objArray1[num1] != null)
{
flag1 = false;
}
}
if (flag1)
{
return null;
}
return objArray1;
}
void IStateManager.TrackViewState()
{
this.isTrackingViewState = true;
foreach (Toolbar toolbar1 in this.toolbars)
{
((IStateManager) toolbar1).TrackViewState();
}
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int Count
{
get
{
return this.toolbars.Count;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
public bool IsSynchronized
{
get
{
return false;
}
}
public Toolbar this[int index]
{
get
{
return (Toolbar) this.toolbars[index];
}
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public object SyncRoot
{
get
{
return this;
}
}
bool IStateManager.IsTrackingViewState
{
get
{
return this.isTrackingViewState;
}
}
private bool isTrackingViewState;
private bool saveAll;
private ArrayList toolbars;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -