Inheritance: IDisposable
Exemplo n.º 1
0
		public void Remove(Element e)
		{
			if (e == null)
				return;
			for (int i = Elements.Count; i > 0;)
			{
				i--;
				if (Elements[i] == e)
				{
					RemoveRange(i, 1);
					return;
				}
			}
		}
Exemplo n.º 2
0
		public int GetElementViewType(Element e)
		{
			var elementType = e.GetType().FullName;

			for (int i = 0; i < ElementTypes.Count; i++)
			{
				if (ElementTypes[i].Equals(elementType))
					return i + 1;
			}

			return 0;
		}
Exemplo n.º 3
0
		/// <summary>
		/// Adds a new child Element to the Section
		/// </summary>
		/// <param name="element">
		/// An element to add to the section.
		/// </param>
		public void Add(Element element)
		{
			if (element == null)
				return;

			var elementType = element.GetType().FullName;

			if (!ElementTypes.Contains(elementType))
				ElementTypes.Add(elementType);

			Elements.Add(element);
			element.Parent = this;

			if (Parent != null)
				InsertVisual(Elements.Count - 1, 1);
		}