toolbaritemslist.cs

来自「FreeTextBox HTML在线编辑器源代码 (C#源代码)阅读一下对掌握」· CS 代码 · 共 78 行

CS
78
字号
using System;
using System.Collections;

namespace FreeTextBoxControls.Common
{
	/// <summary>
	/// Collection of ToolbarItems for Toolbar
	/// </summary>
	public class ToolbarItemsList : IEnumerator, IEnumerable
	{
		public ToolbarItemsList() {}

		private ArrayList itemArray = new ArrayList();
		private int index = -1;
		// Return this class as the Enumerator
		public IEnumerator GetEnumerator()
		{
			return (IEnumerator) this;
		}
		public bool MoveNext()
		{
			index++;
			if (index < itemArray.Count)
			{
				return true;
			} 
			else
			{
				return false;
			}
		}
		public void Reset()
		{
			index = -1;
		}
		public object Current
		{
			get
			{
				return itemArray[index];
			}
		}
		public void Add(ToolbarItem item)
		{
			itemArray.Add(item);
		}
		//FIX: Ethan J. Brown
		public void Remove(ToolbarItem item)
		{
			itemArray.Remove(item);
		}
		public void Clear()
		{
			itemArray.Clear();
		}
		/// <summary>
		/// The Items (ToolbarButton, ToolbarDropDownList, ToolbarSeparator, ToolbarLabel) in the toolbar
		/// </summary>
		public ToolbarItem this[Int32 index]
		{
			get
			{
				return (ToolbarItem) itemArray[index];
			}
			set
			{
				itemArray[index] = value;
			}
		}
		public int Count
		{
			get
			{
				return itemArray.Count;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?