Ejemplo n.º 1
0
        private XNode ConvertContent(InlineRunWithProperty rwp)
        {
            switch (rwp.Property)
            {
            case InlineProperty.Del:
                return(null);

            case InlineProperty.None:
            case InlineProperty.Ins:
            case InlineProperty.Emp:
                break;

            default:
                throw new ApplicationException("Internal error");
            }

            var run = rwp.Run;

            if (run is InlineText)
            {
                return(new XText(run.ToString()));
            }
            else if (run is InlineTag)
            {
                // Create a TMX <ph> tag for any tag, giving a fake content.
                var tag = run as InlineTag;
                return(new XElement(X + "ph",
                                    new XAttribute("x", tag.Number),
                                    "{" + tag.Number + "}"));
            }
            else
            {
                throw new ApplicationException("Internal error");
            }
        }
Ejemplo n.º 2
0
        private XNode ConvertContent(InlineRunWithProperty element_with_property)
        {
            throw new NotImplementedException();

            //if (item is InlineText)
            //{
            //    return new XText(item.ToString());
            //}
            //else if (item is InlineTag)
            //{
            //    // Create a TMX <ph> tag for any tag.
            //    var tag = item as InlineTag;
            //    return new XElement(X + "ph",
            //        new XAttribute("x", tag.Number),
            //        "{" + tag.Number + "}");
            //}
            //else
            //{
            //    throw new Exception("Internal error");
            //}
        }
Ejemplo n.º 3
0
 private Rwp(InlineRunWithProperty rwp)
 {
     Value = rwp;
 }