Exemplo n.º 1
0
		public int GetNodeIndex(BasicNode target)
		{
			for (int i = 0; i < NodeCount; i++)
			{
				if (vNodes[i] == target)
				{
					return i;
				}
			}
			return -1;
		}
Exemplo n.º 2
0
		public void Disconnect(BasicNode target)
		{
			int i = GetNodeIndex(target);
			if (NodeOnDisconnect != null)
			{
				if ((byte)NodeOnDisconnect(this, target) == CancelOperation)
				{
					return;
				}
			}
			if (i >= 0)
			{
				vNodes[i] = null;
			}
		}
Exemplo n.º 3
0
		public byte Connect(BasicNode target)
		{
			int i = GetNodeIndex(null);
			if (NodeOnDisconnect != null)
			{
				if ((byte)NodeOnDisconnect(this, target) == CancelOperation)
				{
					return CancelOperation;
				}
			}
			if (i < 0)
			{
				return ErrNodeListFull;
			}
			else
			{
				vNodes[i] = target;
				return Successful;
			}
		}