Exemplo n.º 1
0
        /// <summary>
        /// Initializes the class
        /// </summary>
        /// <param name="id">The id</param>
        /// <param name="displayOrder">The display order</param>
        /// <param name="parentId">The parent identifier</param>
        /// <param name="childrenIds">The children ids</param>
        /// <param name="boundingBox">The bounding box</param>
        /// <param name="classifications">The classifications</param>
        /// <param name="tagName">The tag name</param>
        /// <param name="outerHtml">The outer html</param>
        /// <param name="innerHtml">The inner html</param>
        /// <param name="outerText">The outer text</param>
        /// <param name="attributes">The attributes</param>
        /// <param name="styles">The styles</param>
        /// <param name="defaultStyleLookup">The default style lookup</param>
        public void Initialize(int id, int displayOrder, int?parentId, IReadOnlyList <int> childrenIds, Rectangle boundingBox, IEnumerable <string> classifications,
                               string tagName, string outerHtml, string innerHtml, string outerText,
                               IDictionary <string, string> attributes, IDictionary <string, string> styles, DefaultStyleLookup defaultStyleLookup)
        {
            if (attributes == null)
            {
                throw new ArgumentNullException("attributes");
            }

            if (styles == null)
            {
                throw new ArgumentNullException("styles");
            }

            if (defaultStyleLookup == null)
            {
                throw new ArgumentNullException("defaultStyleLookup");
            }

            base.Initialize(id, displayOrder, parentId, childrenIds, boundingBox, classifications);
            this.TagName   = tagName;
            this.InnerHtml = innerHtml;
            this.OuterHtml = outerHtml;
            this.OuterText = outerText;
            this.SetAttributes(attributes);
            this.SetStyles(styles);
            this.SetDefaultStyleLookup(defaultStyleLookup);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlElement" /> class
 /// </summary>
 /// <param name="id">The id</param>
 /// <param name="displayOrder">The display order</param>
 /// <param name="parentId">The parent id</param>
 /// <param name="childrenIds">The children ids</param>
 /// <param name="boundingBox">The bounding box</param>
 /// <param name="classifications">The classifications</param>
 /// <param name="tagName">Tag name</param>
 /// <param name="outerHtml">The outer html</param>
 /// <param name="innerHtml">The inner html</param>
 /// <param name="outerText">The outer text</param>
 /// <param name="attributes">The attributes</param>
 /// <param name="styles">The styles</param>
 /// <param name="defaultStyleLookup">The default style lookup</param>
 public HtmlElement(int id, int displayOrder, int?parentId, IReadOnlyList <int> childrenIds, Rectangle boundingBox, IEnumerable <string> classifications,
                    string tagName, string outerHtml, string innerHtml, string outerText,
                    IDictionary <string, string> attributes, IDictionary <string, string> styles, DefaultStyleLookup defaultStyleLookup)
 {
     this.Initialize(id, displayOrder, parentId, childrenIds, boundingBox, classifications, tagName, outerHtml, innerHtml, outerText, attributes, styles, defaultStyleLookup);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes the class
 /// </summary>
 /// <param name="root">The root element</param>
 /// <param name="info">The HTML document information</param>
 /// <param name="defaultStyleLookup">The default style lookup</param>
 public void Initialize(HtmlElement root, HtmlDocumentInfo info, DefaultStyleLookup defaultStyleLookup)
 {
     base.Initialize(root);
     this.Info = info;
     this.DefaultStyleLookup = defaultStyleLookup;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Sets the default style lookup
 /// </summary>
 /// <param name="defaultStyleLookup">The default style lookup</param>
 protected void SetDefaultStyleLookup(DefaultStyleLookup defaultStyleLookup)
 {
     _defaultStyleLookup = defaultStyleLookup;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlDocument" /> class
 /// </summary>
 /// <param name="root">The root element</param>
 /// <param name="info">The HTML document information</param>
 /// <param name="defaultStyleLookup">The default style lookup</param>
 public HtmlDocument(HtmlElement root, HtmlDocumentInfo info, DefaultStyleLookup defaultStyleLookup)
     : base(root)
 {
     this.Info = info;
     this.DefaultStyleLookup = defaultStyleLookup;
 }