functioninfocollection.cs
来自「这是用VC编写的一个关于计算器的代码」· CS 代码 · 共 89 行
CS
89 行
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ProgramCalculator
{
/// <summary>
/// 用于保存FunctionInfo对象的集合
/// </summary>
public class FunctionInfoCollection:ICollection
{
private ArrayList alCollection = new ArrayList();
public FunctionInfoCollection()
{
}
/// <summary>
/// 索引器
/// </summary>
/// <param name="index">索引号</param>
/// <returns></returns>
public FunctionInfo this[int index]
{
get
{
return (FunctionInfo) this.alCollection[index];
}
set
{
this.alCollection[index] = value;
}
}
/// <summary>
/// 添加元素到集合
/// </summary>
/// <param name="fInfo">要添加的FunctionInfo对象</param>
public int Add(FunctionInfo fInfo)
{
return this.alCollection.Add(fInfo);
}
/// <summary>
/// 从集合移出特定元素的第一个匹配项
/// </summary>
/// <param name="fInfo"></param>
public void Remove(FunctionInfo fInfo)
{
this.alCollection.Remove(fInfo);
}
#region ICollection 成员
public void CopyTo(Array array, int index)
{
this.alCollection.CopyTo(array, index);
}
public int Count
{
get { return this.alCollection.Count; }
}
public bool IsSynchronized
{
get { return false; }
}
public object SyncRoot
{
get { return this; }
}
#endregion
#region IEnumerable 成员
public IEnumerator GetEnumerator()
{
return this.alCollection.GetEnumerator();
}
#endregion
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?