public virtual void PreElementWork(hglParser.Element xe) { hglElement = xe; xe.id = xe.attrib["id"] != null ? (string)xe.attrib["id"] : null; hglTags.StyleElementWork(this); xe.colorIndex = hglTags.m_htmlRender.m_htmlColor.GetNewIndex(Color.white); hglConverter.referenceFontSize = xe.thisStyle.GetFloat(StyleKey.font_size, float.NaN); if (xe.attrib["onclick"] != null) { ainfo = new hglAnchor.Info(); ainfo.m_url = "javascript:" + (string)xe.attrib["onclick"]; } }
public override void ElementWork(hglParser.Element te) { string url = null; m_mode = hglAnchor.MODE.JUMP; var atrs = te.attrib; if (atrs["href"] != null) { if (ainfo == null) { ainfo = new hglAnchor.Info(); } ainfo = new hglAnchor.Info(); ainfo.m_url = (string)atrs["href"]; } //if (atrs["onclick"] != null) // @@ onclick has been processed at hglBaseBody @@ //{ // url = "javascript:" + (string)atrs["onclick"] ; //} if (atrs["a"] != null) { m_mode = hglAnchor.MODE.ANCHOR; url = (string)atrs["a"]; } if (ainfo != null) { //Color ainfo.m_hover = (hglTags.m_styleSheet.GetLinkStyleColor("a:hover", out ainfo.m_hover) || hglTags.m_styleSheet.GetLinkStyleColor(":hover", out ainfo.m_hover)) ? ainfo.m_hover : Color.green; ainfo.m_link = (hglTags.m_styleSheet.GetLinkStyleColor("a:link", out ainfo.m_link) || hglTags.m_styleSheet.GetLinkStyleColor(":link", out ainfo.m_link)) ? ainfo.m_link : Color.blue; ainfo.m_visited = (hglTags.m_styleSheet.GetLinkStyleColor("a:visited", out ainfo.m_visited) || hglTags.m_styleSheet.GetLinkStyleColor(":visited", out ainfo.m_visited)) ? ainfo.m_visited : Color.gray; ainfo.m_pressed = (hglTags.m_styleSheet.GetLinkStyleColor("a:pressed", out ainfo.m_pressed) || hglTags.m_styleSheet.GetLinkStyleColor(":pressed", out ainfo.m_pressed)) ? ainfo.m_pressed : Color.red; } }