Exemplo n.º 1
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     if (binder.Name == "text")
         result = new MarkupText();
     else
         result = new MarkupElement(binder.Name);
     return true;
 }
Exemplo n.º 2
0
        protected virtual void ArrangeInternal(Rectangle bounds, MarkupDrawContext d)
        {
            SerialContentLayoutManager layout = GetLayoutManager(d.AllowMultiLine);
            layout.RightToLeft = d.RightToLeft;
            MarkupLayoutManager markupLayout = GetMarkupLayout();
            markupLayout.MarkupDrawContext = d;
            try
            {
                MarkupElement[] blocks = new MarkupElement[this.Elements.Count];
                this.Elements.CopyTo(blocks);

                Rectangle r = layout.Layout(new Rectangle(Point.Empty, bounds.Size), blocks, markupLayout);
                this.Bounds = new Rectangle(bounds.Location, r.Size);
            }
            finally
            {
                markupLayout.MarkupDrawContext = null;
            }
        }
Exemplo n.º 3
0
 public MarkTranslatorElement(MarkupElement from, MarkupElement to, bool canBeParent = true)
 {
     From        = from;
     To          = to;
     CanBeParent = canBeParent;
 }
Exemplo n.º 4
0
		/// <summary>
		/// Removes specified object from the collection.
		/// </summary>
		/// <param name="value"></param>
		public void Remove(MarkupElement value) 
		{
			List.Remove(value);
		}
Exemplo n.º 5
0
		/// <summary>
		/// Returns whether collection contains specified object.
		/// </summary>
		/// <param name="value">Object to look for.</param>
		/// <returns>true if object is part of the collection, otherwise false.</returns>
		public bool Contains(MarkupElement value) 
		{
			return List.Contains(value);
		}
Exemplo n.º 6
0
		/// <summary>
		/// Returns index of the object inside of the collection.
		/// </summary>
		/// <param name="value">Reference to the object.</param>
		/// <returns>Index of the object.</returns>
		public int IndexOf(MarkupElement value) 
		{
			return List.IndexOf(value);
		}
Exemplo n.º 7
0
		/// <summary>
		/// Inserts new object into the collection.
		/// </summary>
		/// <param name="index">Position of the object.</param>
		/// <param name="value">Object to insert.</param>
		public void Insert(int index, MarkupElement value) 
		{
			List.Insert(index, value);
		}
Exemplo n.º 8
0
		/// <summary>
		/// Adds new object to the collection.
		/// </summary>
		/// <param name="MarkupElement">Object to add.</param>
		/// <returns>Index of newly added object.</returns>
		public int Add(MarkupElement MarkupElement)
		{
			return List.Add(MarkupElement);
		}
Exemplo n.º 9
0
        /// <summary>Creates new instance of the class.</summary>
        public MarkupElementCollection(MarkupElement parent)
		{
            m_Parent = parent;
		}
Exemplo n.º 10
0
		/// <summary>
		/// Copies contained items to the MarkupElement array.
		/// </summary>
		/// <param name="array">Array to copy to.</param>
		internal void CopyTo(MarkupElement[] array)
		{
			List.CopyTo(array,0);
		}
Exemplo n.º 11
0
		/// <summary>
		/// Copies collection into the specified array.
		/// </summary>
		/// <param name="array">Array to copy collection to.</param>
		/// <param name="index">Starting index.</param>
		public void CopyTo(MarkupElement[] array, int index) 
		{
			List.CopyTo(array, index);
		}
Exemplo n.º 12
0
 public EndMarkupElement(MarkupElement startElement)
 {
     m_StartElement = startElement;
 }
Exemplo n.º 13
0
 internal void SetParent(MarkupElement parent)
 {
     m_Parent = parent;
 }