Exemplo 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);
     }
 }
Exemplo 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();
 }
Exemplo 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();
 }
Exemplo 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
     };
 }
Exemplo n.º 5
0
Arquivo: CssBox.cs Projeto: 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
     };
 }
Exemplo n.º 6
0
Arquivo: CssBox.cs Projeto: 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
     };
 }
Exemplo 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);
        }
Exemplo n.º 8
0
 public HtmlPageControl(HtmlElement existingElement)
     : base(existingElement)
 {
     // Attempt to load these immediately
     try
     {
         HtmlControlBase body = Body;
         HtmlControlBase head = Header;
     }
     catch (InvalidOperationException)
     {
     }
 }
Exemplo 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)
 {
 }
Exemplo 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) { }
Exemplo 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)
 {
 }
Exemplo 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);
 }
Exemplo 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;
 }
Exemplo 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);
        }
Exemplo 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;
        }
Exemplo 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) { }
Exemplo 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)
 {
 }
Exemplo 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) { }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a FontInfo object.
 /// </summary>
 /// <param name="owner">The owning Control reference.</param>
 public FontInfo(HtmlControlBase owner)
 {
     _owner = owner;
 }
Exemplo n.º 20
0
 /// <summary>
 /// Initializes a FontInfo object.
 /// </summary>
 /// <param name="owner">The owning Control reference.</param>
 public FontInfo(HtmlControlBase owner) 
 {
     _owner = owner;
 }
Exemplo 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) { }
Exemplo 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);
     }
 }
Exemplo 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);
 }
Exemplo 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)
 {
 }