public virtual object Clone() { Tag tag = new Tag { Name = this.Name, TagType = this.TagType }; foreach (string str in this._x233f092c536593eb.Keys) { string str2 = this._x233f092c536593eb[str]; tag.Attributes[str] = str2; } return tag; }
/// <summary> /// Called by loadContents to load a form on the page. /// </summary> /// <param name="index">The index to begin loading at.</param> /// <param name="tag">The beginning tag.</param> protected void LoadForm(int index, Tag tag) { String method = tag.GetAttributeValue("method"); String action = tag.GetAttributeValue("action"); var form = new Form(_page); form.Begin = index; form.End = FindEndTag(index + 1, tag); if ((method == null) || string.Compare(method, "GET", true) == 0) { form.Method = Form.FormMethod.Get; } else { form.Method = Form.FormMethod.Post; } if (action == null) { form.Action = new Address(_baseURL); } else { form.Action = new Address(_baseURL, action); } _page.AddContent(form); _lastForm = form; }
/// <summary> /// Find the end tag that lines up to the beginning tag. /// </summary> /// <param name="index">The index to start the search on. This specifies /// the starting data unit.</param> /// <param name="tag">The beginning tag that we are seeking the end tag /// for.</param> /// <returns>The index that the ending tag was found at. Returns -1 /// if not found.</returns> protected int FindEndTag(int index, Tag tag) { int depth = 0; int count = index; while (count < _page.getDataSize()) { DataUnit du = _page.GetDataUnit(count); if (du is TagDataUnit) { Tag nextTag = ((TagDataUnit) du).Tag; if (String.Compare(tag.Name, nextTag.Name, true) == 0) { if (nextTag.TagType == Tag.Type.End) { if (depth == 0) { return count; } depth--; } else if (nextTag.TagType == Tag.Type.Begin) { depth++; } } } count++; } return -1; }
/// <summary> /// Clone this object. /// </summary> /// <returns>A cloned copy of the object.</returns> public virtual object Clone() { var result = new Tag {Name = Name, TagType = TagType}; foreach (String key in _attributes.Keys) { String value = _attributes[key]; result.Attributes[key] = value; } return result; }
/// <summary> /// Clone this object. /// </summary> /// <returns>A cloned copy of the object.</returns> public virtual object Clone() { Tag result = new Tag(); result.Name = this.Name; result.TagType = this.TagType; foreach (String key in this.attributes.Keys) { String value = this.attributes[key]; result.Attributes[key] = value; } return result; }
/// <summary> /// Called by loadContents to load a link on the page. /// </summary> /// <param name="index">The index to begin loading at.</param> /// <param name="tag">The beginning tag.</param> protected void LoadLink(int index, Tag tag) { Link link = new Link(this.page); String href = tag.GetAttributeValue("href"); if (href != null) { link.setTarget(new Address(this.baseURL, href)); link.Begin = index; link.End = FindEndTag(index + 1, tag); this.page.AddContent(link); } }
/// <summary> /// Called by loadContents to load a div tag. /// </summary> /// <param name="index">The index to begin at.</param> /// <param name="tag">The beginning div tag.</param> private void LoadDiv(int index, Tag tag) { var div = new Div(_page); String classAttribute = tag.GetAttributeValue("class"); String idAttribute = tag.GetAttributeValue("id"); div.IdAttribute = idAttribute; div.ClassAttribute = (classAttribute); div.Begin = index; div.End = FindEndTag(index + 1, tag); AddHierarchyElement(div); }
/// <summary> /// Called by loadContents to load the title of the page. /// </summary> /// <param name="index">The index to begin loading at.</param> /// <param name="tag">The beginning tag.</param> protected void LoadTitle(int index, Tag tag) { var title = new DocumentRange(_page); title.Begin = index; title.End = FindEndTag(index + 1, tag); _page.Title = title; }
private void xc4283bf79484a931(int xc0c4c459c6ccbd00, Tag xffe521cc76054baf) { Span span = new Span(this._xbbe2f7d7c86e0379); string attributeValue = xffe521cc76054baf.GetAttributeValue("class"); string str2 = xffe521cc76054baf.GetAttributeValue("id"); span.IdAttribute = str2; span.ClassAttribute = attributeValue; if (((uint) xc0c4c459c6ccbd00) >= 0) { span.Begin = xc0c4c459c6ccbd00; span.End = this.FindEndTag(xc0c4c459c6ccbd00 + 1, xffe521cc76054baf); } this.x9d4db4971b8e4b59(span); }
private void x83582e0ac008c5cb(Tag xffe521cc76054baf) { TagDataUnit unit = new TagDataUnit { Tag = (Tag) xffe521cc76054baf.Clone() }; this._xbbe2f7d7c86e0379.AddDataUnit(unit); }
protected void LoadTitle(int index, Tag tag) { DocumentRange range = new DocumentRange(this._xbbe2f7d7c86e0379) { Begin = index, End = this.FindEndTag(index + 1, tag) }; this._xbbe2f7d7c86e0379.Title = range; }
protected void LoadLink(int index, Tag tag) { Link span = new Link(this._xbbe2f7d7c86e0379); string attributeValue = tag.GetAttributeValue("href"); if (attributeValue != null) { span.Target = new Address(this._x1554c0f0264b8597, attributeValue); span.Begin = index; if ((((uint) index) + ((uint) index)) >= 0) { span.End = this.FindEndTag(index + 1, tag); } this._xbbe2f7d7c86e0379.AddContent(span); } }
protected void LoadInput(int index, Tag tag) { string str2; string str3; Input input; string attributeValue = tag.GetAttributeValue("type"); goto Label_007E; Label_0043: if (this._xddf51e0bb7096df0 != null) { this._xddf51e0bb7096df0.AddElement(input); return; } if ((((uint) index) + ((uint) index)) <= uint.MaxValue) { this._xbbe2f7d7c86e0379.AddContent(input); if (((uint) index) >= 0) { return; } goto Label_007E; } Label_0067: input.Type = attributeValue; input.Name = str2; Label_0075: input.Value = str3; goto Label_0043; Label_007E: str2 = tag.GetAttributeValue("name"); str3 = tag.GetAttributeValue("value"); input = new Input(this._xbbe2f7d7c86e0379); if (8 == 0) { goto Label_0075; } if (0 == 0) { goto Label_0067; } goto Label_0043; }
protected void LoadForm(int index, Tag tag) { string str2; Form form; string attributeValue = tag.GetAttributeValue("method"); goto Label_00E4; Label_0011: if (str2 == null) { form.Action = new Address(this._x1554c0f0264b8597); } else { form.Action = new Address(this._x1554c0f0264b8597, str2); } this._xbbe2f7d7c86e0379.AddContent(form); this._xddf51e0bb7096df0 = form; if (0 != 0) { goto Label_00E4; } if ((((uint) index) - ((uint) index)) <= uint.MaxValue) { return; } Label_0057: form.Method = Form.FormMethod.Post; goto Label_0011; Label_007A: if (attributeValue != null) { goto Label_00C9; } Label_007D: form.Method = Form.FormMethod.Get; goto Label_0011; Label_00C9: if (string.Compare(attributeValue, "GET", true) != 0) { goto Label_0057; } if (0 == 0) { goto Label_007D; } goto Label_007A; Label_00E4: str2 = tag.GetAttributeValue("action"); form = new Form(this._xbbe2f7d7c86e0379); if (0 == 0) { if ((((uint) index) & 0) == 0) { form.Begin = index; form.End = this.FindEndTag(index + 1, tag); } if ((((uint) index) - ((uint) index)) <= uint.MaxValue) { goto Label_007A; } goto Label_00C9; } goto Label_0057; }
/// <summary> /// Called by loadContents to load an input tag on the form. /// </summary> /// <param name="index">The index to begin loading at.</param> /// <param name="tag">The beginning tag.</param> protected void LoadInput(int index, Tag tag) { String type = tag.GetAttributeValue("type"); String name = tag.GetAttributeValue("name"); String value = tag.GetAttributeValue("value"); var input = new Input(_page); input.Type = type; input.Name = name; input.Value = value; if (_lastForm != null) { _lastForm.AddElement(input); } else { _page.AddContent(input); } }
/// <summary> /// Called by loadContents to load a link on the page. /// </summary> /// <param name="index">The index to begin loading at.</param> /// <param name="tag">The beginning tag.</param> protected void LoadLink(int index, Tag tag) { var link = new Link(_page); String href = tag.GetAttributeValue("href"); if (href != null) { link.Target = new Address(_baseURL, href); link.Begin = index; link.End = FindEndTag(index + 1, tag); _page.AddContent(link); } }
private void xd333635ed28a1b6d(int xc0c4c459c6ccbd00, Tag xffe521cc76054baf) { string str; Div div = new Div(this._xbbe2f7d7c86e0379); if ((((uint) xc0c4c459c6ccbd00) - ((uint) xc0c4c459c6ccbd00)) >= 0) { str = xffe521cc76054baf.GetAttributeValue("class"); } string attributeValue = xffe521cc76054baf.GetAttributeValue("id"); div.IdAttribute = attributeValue; div.ClassAttribute = str; div.Begin = xc0c4c459c6ccbd00; div.End = this.FindEndTag(xc0c4c459c6ccbd00 + 1, xffe521cc76054baf); do { this.x9d4db4971b8e4b59(div); } while (0xff == 0); }
/// <summary> /// Create a tag data unit. /// </summary> /// <param name="tag">The tag name to create the data unit for.</param> private void CreateTagDataUnit(Tag tag) { var d = new TagDataUnit {Tag = (Tag) tag.Clone()}; _page.AddDataUnit(d); }
protected int FindEndTag(int index, Tag tag) { int num2; int num = 0; goto Label_00E9; Label_001D: num2++; Label_0021: if (num2 < this._xbbe2f7d7c86e0379.getDataSize()) { DataUnit dataUnit = this._xbbe2f7d7c86e0379.GetDataUnit(num2); Label_00B8: if (!(dataUnit is TagDataUnit)) { goto Label_001D; } Tag tag2 = ((TagDataUnit) dataUnit).Tag; if ((((uint) num2) + ((uint) index)) <= uint.MaxValue) { if (string.Compare(tag.Name, tag2.Name, true) == 0) { if (tag2.TagType != Tag.Type.End) { if (tag2.TagType != Tag.Type.Begin) { goto Label_001D; } if ((((uint) num) - ((uint) num2)) >= 0) { num++; if (((uint) num2) <= uint.MaxValue) { goto Label_001D; } goto Label_010C; } goto Label_00E9; } if (num != 0) { num--; goto Label_001D; } if ((4 != 0) && ((((uint) index) | 0x7fffffff) != 0)) { return num2; } } else { goto Label_001D; } goto Label_00B8; } } else { goto Label_010C; } Label_00E9: num2 = index; goto Label_0021; Label_010C: return -1; }
/// <summary> /// Called by loadContents to load a span. /// </summary> /// <param name="index">The index to begin loading at.</param> /// <param name="tag">The beginning tag.</param> private void LoadSpan(int index, Tag tag) { var span = new Span(_page); String classAttribute = tag.GetAttributeValue("class"); String idAttribute = tag.GetAttributeValue("id"); span.IdAttribute = idAttribute; span.ClassAttribute = classAttribute; span.Begin = index; span.End = FindEndTag(index + 1, tag); AddHierarchyElement(span); }
/// <summary> /// Create a tag data unit. /// </summary> /// <param name="tag">The tag name to create the data unit for.</param> private void CreateTagDataUnit(Tag tag) { TagDataUnit d = new TagDataUnit(); d.Tag = (Tag)tag.Clone(); this.page.AddDataUnit(d); }