⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functioninfocollection.cs

📁 这是用VC编写的一个关于计算器的代码
💻 CS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -