Ejemplo n.º 1
0
 /// <summary>
 /// Sets the managed HtmlControlBase parent, if it exists and is
 /// registered, for an HtmlElement.
 /// </summary>
 /// <param name="parentHtmlElement">The parent HtmlElement.</param>
 private void SetParentIfExists(HtmlElement parentHtmlElement)
 {
     if (parentHtmlElement != null && _parent == null && _allControls.HasControl(parentHtmlElement))
     {
         _parent = _allControls.GetControl(parentHtmlElement);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Used by an extension method on System.Windows.Browser.HtmlElement to
 /// hook a managed control up by creating a real underlying element.
 /// </summary>
 /// <param name="parent">The HtmlElement to append the managed 
 /// HtmlControl to.</param>
 /// <param name="control">The managed HtmlControlBase or HtmlControl to 
 /// append, Initialize, and create with a real element.</param>
 internal static void AppendAndInitialize(HtmlElement parent, HtmlControlBase control)
 {
     // If the control is already out there with live and active 
     // elements, the net effect of these calls is simply to initialize 
     // any children of the control.
     control.CreateAndAppend(parent);
     control.Initialize();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Used by an extension method on System.Windows.Browser.HtmlElement to
 /// hook a managed control up by creating a real underlying element.
 /// </summary>
 /// <param name="parent">The HtmlElement to append the managed
 /// HtmlControl to.</param>
 /// <param name="control">The managed HtmlControlBase or HtmlControl to
 /// append, Initialize, and create with a real element.</param>
 internal static void AppendAndInitialize(HtmlElement parent, HtmlControlBase control)
 {
     // If the control is already out there with live and active
     // elements, the net effect of these calls is simply to initialize
     // any children of the control.
     control.CreateAndAppend(parent);
     control.Initialize();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new CssSize.
 /// </summary>
 /// <param name="element">The element.</param>
 /// <param name="width">The width CSS property.</param>
 /// <param name="height">The height CSS property.</param>
 public CssSize(HtmlControlBase element, CssAttribute width, CssAttribute height)
     : base()
 {
     _mhe           = element;
     _cssProperties = new CssAttribute[]
     {
         width,
         height
     };
 }
Ejemplo n.º 5
0
Archivo: CssBox.cs Proyecto: ynkbt/moon
 /// <summary>
 /// Initializes a new CssBox type with the specified CSS property names.
 /// </summary>
 /// <param name="element">The parent managed HTML element.</param>
 /// <param name="top">The top property.</param>
 /// <param name="right">The right property.</param>
 /// <param name="bottom">The bottom property.</param>
 /// <param name="left">The left property.</param>
 public CssBox(HtmlControlBase element, CssAttribute top, CssAttribute right, CssAttribute bottom, CssAttribute left) : base()
 {
     _mhe           = element;
     _cssProperties = new CssAttribute[]
     {
         top,
         right,
         bottom,
         left
     };
 }
Ejemplo n.º 6
0
Archivo: CssBox.cs Proyecto: dfr0/moon
 /// <summary>
 /// Initializes a new CssBox type with the specified CSS property names.
 /// </summary>
 /// <param name="element">The parent managed HTML element.</param>
 /// <param name="top">The top property.</param>
 /// <param name="right">The right property.</param>
 /// <param name="bottom">The bottom property.</param>
 /// <param name="left">The left property.</param>
 public CssBox(HtmlControlBase element, CssAttribute top, CssAttribute right, CssAttribute bottom, CssAttribute left) : base()
 {
     _mhe = element;
     _cssProperties = new CssAttribute[] 
     {
         top,
         right,
         bottom,
         left
     };
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Retrieves a managed control instance, if any, for the HTML element.
        /// </summary>
        /// <param name="element">The HTML element.</param>
        /// <returns>Returns the managed control for an HTML element.</returns>
        public HtmlControlBase GetControl(HtmlElement element)
        {
            WeakReference   key   = GetKey(element);
            HtmlControlBase value = null;

            if (key != null && _managedControls.ContainsKey(key))
            {
                value = _managedControls[key];
            }
            return(value);
        }
Ejemplo n.º 8
0
 public HtmlPageControl(HtmlElement existingElement)
     : base(existingElement)
 {
     // Attempt to load these immediately
     try
     {
         HtmlControlBase body = Body;
         HtmlControlBase head = Header;
     }
     catch (InvalidOperationException)
     {
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new margin type for the control.
 /// </summary>
 /// <param name="element">The owning element.</param>
 public CssMargin(HtmlControlBase element) : base(element, CssAttribute.MarginTop, CssAttribute.MarginRight, CssAttribute.MarginBottom, CssAttribute.MarginLeft)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new position type.
 /// </summary>
 /// <param name="element">The owning element.</param>
 public CssPosition(HtmlControlBase element) : base(element, CssAttribute.Top, CssAttribute.Right, CssAttribute.Bottom, CssAttribute.Left) { }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new padding type.
 /// </summary>
 /// <param name="element">The owning element.</param>
 public CssPadding(HtmlControlBase element) : base(element, CssAttribute.PaddingTop, CssAttribute.PaddingRight, CssAttribute.PaddingBottom, CssAttribute.PaddingLeft)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Append the managed HtmlControl to the HtmlElement.  Extension method
 /// for HtmlElement.
 /// </summary>
 /// <param name="element">The HtmlElement.</param>
 /// <param name="control">The managed HtmlControlBase / HtmlControl.</param>
 public static void AppendChild(this HtmlElement element, HtmlControlBase control)
 {
     HtmlControlBase.AppendAndInitialize(element, control);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Register a managed HTML element control with the collection.
 /// </summary>
 /// <param name="control">The Control object.</param>
 public void RegisterControl(HtmlControlBase control)
 {
     WeakReference wr = new WeakReference(control.HtmlElement);
     _managedControls[wr] = control;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Check if the HtmlElement has a known managed control.
        /// </summary>
        /// <param name="element">The element object.</param>
        /// <returns>Returns whether the element has an attached control.</returns>
        public bool HasControl(HtmlElement element)
        {
            HtmlControlBase hcb = GetControl(element);

            return(hcb != null);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Register a managed HTML element control with the collection.
        /// </summary>
        /// <param name="control">The Control object.</param>
        public void RegisterControl(HtmlControlBase control)
        {
            WeakReference wr = new WeakReference(control.HtmlElement);

            _managedControls[wr] = control;
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Initializes a new padding type.
 /// </summary>
 /// <param name="element">The owning element.</param>
 public CssPadding(HtmlControlBase element) : base(element, CssAttribute.PaddingTop, CssAttribute.PaddingRight, CssAttribute.PaddingBottom, CssAttribute.PaddingLeft) { }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new attached CSS border for a managed HtmlElement.
 /// </summary>
 /// <param name="element">The owner of the border.</param>
 public CssBorder(HtmlControlBase element) : base(element, CssAttribute.BorderTop, CssAttribute.BorderRight, CssAttribute.BorderBottom, CssAttribute.BorderLeft)
 {
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new margin type for the control.
 /// </summary>
 /// <param name="element">The owning element.</param>
 public CssMargin(HtmlControlBase element) : base(element, CssAttribute.MarginTop, CssAttribute.MarginRight, CssAttribute.MarginBottom, CssAttribute.MarginLeft) { }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a FontInfo object.
 /// </summary>
 /// <param name="owner">The owning Control reference.</param>
 public FontInfo(HtmlControlBase owner)
 {
     _owner = owner;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Initializes a FontInfo object.
 /// </summary>
 /// <param name="owner">The owning Control reference.</param>
 public FontInfo(HtmlControlBase owner) 
 {
     _owner = owner;
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new attached CSS border for a managed HtmlElement.
 /// </summary>
 /// <param name="element">The owner of the border.</param>
 public CssBorder(HtmlControlBase element) : base(element, CssAttribute.BorderTop, CssAttribute.BorderRight, CssAttribute.BorderBottom, CssAttribute.BorderLeft) { }
Ejemplo n.º 22
0
 /// <summary>
 /// Sets the managed HtmlControlBase parent, if it exists and is 
 /// registered, for an HtmlElement.
 /// </summary>
 /// <param name="parentHtmlElement">The parent HtmlElement.</param>
 private void SetParentIfExists(HtmlElement parentHtmlElement)
 {
     if (parentHtmlElement != null && _parent == null && _allControls.HasControl(parentHtmlElement))
     {
         _parent = _allControls.GetControl(parentHtmlElement);
     }
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Append the managed HtmlControl to the HtmlElement.  Extension method
 /// for HtmlElement.
 /// </summary>
 /// <param name="element">The HtmlElement.</param>
 /// <param name="control">The managed HtmlControlBase / HtmlControl.</param>
 public static void AppendChild(this HtmlElement element, HtmlControlBase control)
 {
     HtmlControlBase.AppendAndInitialize(element, control);
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Initializes a new position type.
 /// </summary>
 /// <param name="element">The owning element.</param>
 public CssPosition(HtmlControlBase element) : base(element, CssAttribute.Top, CssAttribute.Right, CssAttribute.Bottom, CssAttribute.Left)
 {
 }