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

📄 connectioncollection.cs

📁 英语句子自然语言处理统计分析例子 Statistical parsing of English sentences Shows how to generate parse trees for
💻 CS
字号:
using System;
using System.Collections;
namespace Netron.Lithium
{
	/// <summary>
	/// STC of connections
	/// 
	/// </summary>
	public class ConnectionCollection: CollectionBase
	{
		

		/// <summary>
		/// Adds a connection to the collection
		/// </summary>
		/// <param name="con">a connection</param>
		/// <returns>the index of the added element in the collection</returns>
		public int Add(Connection con)
		{
			return this.InnerList.Add(con);
		}

		/// <summary>
		/// integer indexer; gets the connection stored in the collection in the given position
		/// </summary>
		public Connection this[int index]
		{
			get{return this.InnerList[index] as Connection;}
		}
		/// <summary>
		/// Removes a connection from the collection
		/// </summary>
		/// <param name="con">a connection object</param>
		public void Remove(Connection con)
		{
			this.InnerList.Remove(con);
		}
		/// <summary>
		/// Removes a connection from the collection
		/// </summary>
		/// <param name="one">the 'from' or 'to' (ShapeBase) part of the connection</param>
		/// <param name="two">the complementary 'from' or 'to' (ShapeBase) part of the connection</param>
		public void Remove(ShapeBase one, ShapeBase two)
		{
			for(int k=0; k<InnerList.Count; k++)
			{
				if((this[k].From ==one && this[k].To==two) || (this[k].From ==two && this[k].To==one) )
				{
						this.InnerList.RemoveAt(k);
					break;
				}
			}
		}
	}


}

⌨️ 快捷键说明

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