Example #1
0
 static HtmlNode ParseSource( string htmlSource, HtmlParseOptions options )
 {
     try {
         return new HtmlDocumentParser( htmlSource, options ).Parse();
     }
     catch(ParseException) {
         return new TextNode( htmlSource,0,htmlSource.Length );
     }
 }
Example #2
0
 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);
        }
Example #4
0
        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);
        }
Example #6
0
        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;
        }
Example #7
0
 /// <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)
 {
 }