static HtmlNode ParseSource( string htmlSource, HtmlParseOptions options ) { try { return new HtmlDocumentParser( htmlSource, options ).Parse(); } catch(ParseException) { return new TextNode( htmlSource,0,htmlSource.Length ); } }
public HtmlDocumentParser(string source, HtmlParseOptions options) { if (source == null) { throw new ArgumentNullException(nameof(source)); } _source = source; _options = options; }
public RichTextField() { this.opaque = true; htmlPageContext = HtmlPageContext.inst; htmlParseOptions = new HtmlParseOptions(); this.textField = new TextField(); textField.EnableRichSupport(this); AddChild(textField); }
public RichTextField() { gameObject.name = "RichTextField"; this.opaque = true; htmlPageContext = HtmlPageContext.inst; htmlParseOptions = new HtmlParseOptions(); this.textField = new TextField(); textField.EnableRichSupport(this); AddChild(textField); _refreshObjectsDelegate = InternalRefreshObjects; }
public RichTextField() { CreateGameObject("RichTextField"); htmlPageContext = HtmlPageContext.inst; htmlParseOptions = new HtmlParseOptions(); _textField = new TextField(); _textField._optimizeNotTouchable = false; _textField._richTextField = this; AddChild(_textField); graphics = _textField.graphics; onClick.AddCapture(__click); }
void Create(TextField textField) { CreateGameObject("RichTextField"); this.opaque = true; onFocusIn = new EventListener(this, "onFocusIn"); onFocusOut = new EventListener(this, "onFocusOut"); onChanged = new EventListener(this, "onChanged"); htmlPageContext = HtmlPageContext.inst; htmlParseOptions = new HtmlParseOptions(); this.textField = textField; textField.richTextField = this; AddChild(textField); graphics = textField.graphics; }
/// <summary> /// Constructs an HtmlDocument from a source string plus options. /// Throws ArgumentNullException if htmlSource is null. /// Throws a ParseExcpetion if it can't parse the string. /// </summary> public HtmlDocument( string htmlSource, HtmlParseOptions options, Uri location = null ) : base(htmlSource, ParseSource(htmlSource,options), location) { }