internal TextSegment(IText parent, string text, Color color, Font font) { this.mParent = parent; this.mText = text; this.mTextColor = color; this.mTextFont = font; }
/// <summary> /// Gets the set of TextChanges that describe how the text changed /// between old and new versions. Some containers keep track of changes between /// text instances and may report multiple detailed changes. Others many simply report /// a single change from old to new encompassing the entire text. /// </summary> public static IEnumerable<TextChange> GetTextChanges(this IText newText, IText oldText) { int newPosDelta = 0; var ranges = newText.GetChangeRanges(oldText).ToList(); var textChanges = new List<TextChange>(ranges.Count); foreach (var range in ranges) { var newPos = range.Span.Start + newPosDelta; // determine where in the newText this text exists string newt; if (range.NewLength > 0) { var span = new TextSpan(newPos, range.NewLength); newt = newText.ToString(span); } else { newt = string.Empty; } textChanges.Add(new TextChange(range.Span, newt)); newPosDelta += range.NewLength - range.Span.Length; } return textChanges; }
/// <summary> /// non-undoable task /// </summary> private void DoSetupFixture() { var textFactory = Cache.ServiceLocator.GetInstance<ITextFactory>(); var stTextFactory = Cache.ServiceLocator.GetInstance<IStTextFactory>(); m_text = textFactory.Create(); //Cache.LangProject.TextsOC.Add(m_text); m_stText = stTextFactory.Create(); m_text.ContentsOA = m_stText; m_para0 = m_stText.AddNewTextPara(null); m_para0.Contents = TsStringUtils.MakeTss("Xxxhope xxxthis xxxwill xxxdo. xxxI xxxhope.", Cache.DefaultVernWs); m_para1 = m_stText.AddNewTextPara(null); m_para1.Contents = TsStringUtils.MakeTss("Xxxcertain xxxto xxxcatch xxxa xxxfrog. xxxCertainly xxxcan. xxxOn xxxLake xxxMonroe.", Cache.DefaultVernWs); m_para2 = null; using (ParagraphParser pp = new ParagraphParser(Cache)) foreach (IStTxtPara para in m_stText.ParagraphsOS) pp.Parse(para); m_expectedAnOcs = new List<AnalysisOccurrence>(); foreach (IStTxtPara para in m_stText.ParagraphsOS) foreach (ISegment seg in para.SegmentsOS) for (int i = 0; i < seg.AnalysesRS.Count; i++) m_expectedAnOcs.Add(new AnalysisOccurrence(seg, i)); m_expectedAnOcsPara0 = new List<AnalysisOccurrence>(); foreach (ISegment seg in m_para0.SegmentsOS) for (int i = 0; i < seg.AnalysesRS.Count; i++) m_expectedAnOcsPara0.Add(new AnalysisOccurrence(seg, i)); }
public override void Initialize() { CheckDisposed(); base.Initialize(); //m_inMemoryCache.InitializeAnnotationDefs(); InstallVirtuals(@"Language Explorer\Configuration\Words\AreaConfiguration.xml", new string[] { "SIL.FieldWorks.IText.ParagraphSegmentsVirtualHandler", "SIL.FieldWorks.IText.OccurrencesInTextsVirtualHandler" }); m_wsVern = Cache.DefaultVernWs; m_wsTrans = Cache.DefaultAnalWs; m_text = new Text(); Cache.LangProject.TextsOC.Add(m_text); m_para = new StTxtPara(); StText text = new StText(); m_text.ContentsOA = text; text.ParagraphsOS.Append(m_para); m_trans = new CmTranslation(); m_para.TranslationsOC.Add(m_trans); kflidFT = StTxtPara.SegmentFreeTranslationFlid(Cache); kflidSegments = StTxtPara.SegmentsFlid(Cache); m_btPoss = Cache.LangProject.TranslationTagsOA.LookupPossibilityByGuid( LangProject.kguidTranBackTranslation); m_trans.TypeRA = m_btPoss; m_fWasUseScriptDigits = Cache.LangProject.TranslatedScriptureOA.UseScriptDigits; Cache.LangProject.TranslatedScriptureOA.UseScriptDigits = false; // do we need to set status? }
public TextEditor(int x, int y) { _text = DependencyInjection.Resolve<IText>(); _mouseInput = DependencyInjection.Resolve<IMouseInput>(); _keyboardControl = DependencyInjection.Resolve<IKeyboardControl>(); Position = new Vector2(x, y); Visible = true; }
internal TextSegment(IText parent, string text, Color color, Font font, bool isKey) { this.mParent = parent; this.mText = text; this.mTextColor = color; this.mTextFont = font; this.mIsKeySegment = isKey; }
public DurationControl(int x, int y, IKeyFramesOrderer keyFramesOrderer) { _keyFramesOrderer = keyFramesOrderer; _subtractButton = new TextButton("-", x, y) { Click = Subtract }; _addButton = new TextButton("+", x + 30, y) { Click = Add }; _durationPosition = new Vector2(x + 15, y); _text = DependencyInjection.Resolve<IText>(); }
public void VisitText(IText text) { string segContent = text.Properties.Text; segContent = segContent.Replace("&", "&"); segContent = segContent.Replace("<", "<"); segContent = segContent.Replace(">", ">"); segContent = segContent.Replace("'", "'"); PlainText.Append(segContent); }
public TrivialSyntaxTree(string fileName, SyntaxNode rootNode, ParseOptions options) { this.fileName = fileName; this.rootNode = rootNode; this.options = options; // TODO: HACK HACK HACK HACK HACK HACK: look away, for this is terribly inefficient this.text = new StringText(rootNode.GetFullText()); }
public TextButton(string text, int x, int y) { _guiText = DependencyInjection.Resolve<IText>(); _mouseInput = DependencyInjection.Resolve<IMouseInput>(); Text = text; Position = new Vector2(x, y); Visible = true; }
public static bool IsAvailable(IText text, TextSpan span) { var document = GetDocument(text); return document.GetSyntaxRoot() .DescendantNodes(span) .OfType<PropertyDeclarationSyntax>() .Where(p => CodeGeneration.IsExpandableProperty(p, document)) .Any(); }
/// <summary> /// /// </summary> /// <param name="stringNode"></param> public override void VisitStringNode(IText stringNode) { System.String text = stringNode.GetText(); if (!preTagBeingProcessed) { text = Translate.Decode(text); text = ReplaceNonBreakingSpaceWithOrdinarySpace(text); } textAccumulator.Append(text); }
public LexerBase(IText text, LexerBaseCache cache) { Debug.Assert(cache != null); this.text = text; this.basis = 0; this.start = 0; this.offset = 0; this.textEnd = text.Length; this.cache = cache; this.chars = new char[DefaultWindowLength]; }
private static IDocument GetDocument(IText text) { ProjectId projectId; DocumentId documentId; return Solution.Create(SolutionId.CreateNewId()) .AddCSharpProject("NotifyPropertyChanged", "NotifyPropertyChanged", out projectId) .AddMetadataReference(projectId, MetadataReference.CreateAssemblyReference("mscorlib")) .AddMetadataReference(projectId, MetadataReference.CreateAssemblyReference("System")) .AddDocument(projectId, "ThisFile", text, out documentId) .GetDocument(documentId); }
private void FixtureSetupInternal() { // Setup default analysis ws m_wsEn = Cache.ServiceLocator.WritingSystemManager.Get("en").Handle; m_text = Cache.ServiceLocator.GetInstance<ITextFactory>().Create(); //Cache.LangProject.TextsOC.Add(m_text); Cache.LangProject.TranslatedScriptureOA = Cache.ServiceLocator.GetInstance<IScriptureFactory>().Create(); m_para = Cache.ServiceLocator.GetInstance<IStTxtParaFactory>().Create(); IStText text = Cache.ServiceLocator.GetInstance<IStTextFactory>().Create(); m_text.ContentsOA = text; text.ParagraphsOS.Add(m_para); }
/// <summary> /// Rysuje tekst na obiekt renderera. /// </summary> /// <param name="text">Tekst.</param> /// <param name="color">Kolor.</param> /// <param name="into">Obiekt(utworzony wcześniej przez rodzica) w który zostanie wrysowany tekst.</param> public void Draw(string text, Color color, IText into) { if (into == null) { throw new ArgumentNullException("item"); } else if (!(into is Objects.Internals.SystemFontObject)) { throw new ArgumentException("Text object wasn't created by this class", "into"); } this.DrawString(text, color, (into as Objects.Internals.SystemFontObject).Texture); (into as Objects.Internals.SystemFontObject).Content = text; }
private void FixtureSetupInternal() { //IWritingSystem wsEn = Cache.WritingSystemFactory.get_Engine("en"); // Setup default analysis ws //m_wsEn = Cache.ServiceLocator.GetInstance<ILgWritingSystemRepository>().GetObject(wsEn.WritingSystem); m_wsVern = Cache.DefaultVernWs; m_text = Cache.ServiceLocator.GetInstance<ITextFactory>().Create(); //Cache.LangProject.TextsOC.Add(m_text); m_stText = Cache.ServiceLocator.GetInstance<IStTextFactory>().Create(); m_text.ContentsOA = m_stText; m_para = Cache.ServiceLocator.GetInstance<IScrTxtParaFactory>().CreateWithStyle(m_stText, ScrStyleNames.NormalParagraph); }
public LedgePallete(int x, int y) { _x = x; _y = y; _mapData = DependencyInjection.Resolve<IReadonlyMapData>(); _text = DependencyInjection.Resolve<IText>(); _settings = DependencyInjection.Resolve<IReadOnlySettings>(); _ledgeSelector = new LedgeSelector(x, y, YIncrement); _ledgeFlagsButtons = new FlipTextButton<int>[_mapData.Ledges.Length]; CreateLedgeFlagsButtons(); var ledgesLoader = DependencyInjection.Resolve<ILedgesLoader>(); ledgesLoader.LedgesLoaded += UpdateLedgeFlagsButtonValues; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Create test data for tests. /// </summary> /// ------------------------------------------------------------------------------------ protected override void CreateTestData() { m_servloc = Cache.ServiceLocator; m_text = AddInterlinearTextToLangProj("My Interlinear Text"); m_stTextPara = AddParaToInterlinearTextContents(m_text, "Here is a sentence I can chart."); m_stText = m_text.ContentsOA; m_tssFact = Cache.TsStrFactory; m_rowFact = m_servloc.GetInstance<IConstChartRowFactory>(); m_wordGrpFact = m_servloc.GetInstance<IConstChartWordGroupFactory>(); m_possFact = m_servloc.GetInstance<ICmPossibilityFactory>(); m_wfiFact = m_servloc.GetInstance<IWfiWordformFactory>(); m_mtMrkrFact = m_servloc.GetInstance<IConstChartMovedTextMarkerFactory>(); m_clsMrkrFact = m_servloc.GetInstance<IConstChartClauseMarkerFactory>(); }
public override void Initialize() { CheckDisposed(); base.Initialize(); m_inMemoryCache.InitializeAnnotationDefs(); InstallVirtuals(@"Language Explorer\Configuration\Words\AreaConfiguration.xml", new string[] { "SIL.FieldWorks.IText.ParagraphSegmentsVirtualHandler", "SIL.FieldWorks.IText.OccurrencesInTextsVirtualHandler" }); m_text = new Text(); Cache.LangProject.TextsOC.Add(m_text); m_para = new StTxtPara(); StText text = new StText(); m_text.ContentsOA = text; text.ParagraphsOS.Append(m_para); }
public void Init() { var mockLocalizedManager = new Mock<ILocalizedStringManager>(); mockLocalizedManager .Setup(x => x.GetLocalizedString(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())) .Returns("foo {0}"); var builder = new ContainerBuilder(); builder.RegisterInstance(new StubCultureSelector("fr-CA")).As<ICultureSelector>(); builder.RegisterInstance(new StubWorkContext()).As<WorkContext>(); builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>(); builder.RegisterInstance(mockLocalizedManager.Object); builder.RegisterType<Orchard.Localization.Text>().As<IText>().WithParameter(new NamedParameter("scope", "scope")); _container = builder.Build(); _text = _container.Resolve<IText>(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Creates a text for testing. /// </summary> /// ------------------------------------------------------------------------------------ private void CreateTestText() { m_txt = m_servLoc.GetInstance<ITextFactory>().Create(); //Cache.LangProject.TextsOC.Add(m_txt); m_stTxt = m_servLoc.GetInstance<IStTextFactory>().Create(); m_txt.ContentsOA = m_stTxt; m_txtPara = m_txt.ContentsOA.AddNewTextPara(null); // 0 1 2 3 4 // 0123456789012345678901234567890123456789012 // This is a test string for CopyObject tests. int hvoVernWs = Cache.DefaultVernWs; m_txtPara.Contents = TsStringUtils.MakeTss("This is a test string for CopyObject tests.", hvoVernWs); }
/// <summary> /// Create a new TextReplace structure over the specified <paramref name="oldSpan"/> and having /// the text <paramref name="newText"/> /// <param name="oldSpan">Span in the previous version of IText where the replace is occuring</param> /// <param name="newText">Text being added to the IText</param> /// <param name="text">Version of the IText on which the replace occurs</param> /// </summary> public TextReplace(IText text, TextSpan oldSpan, string newText) { if (text == null) { throw new ArgumentNullException("text"); } if (newText == null) { throw new ArgumentNullException("newText"); } this.text = text; this.oldSpan = oldSpan; this.newText = newText; }
protected void initText(IText textObj, string text, Vector2 position, bool enabled, bool visible, bool drawAtCenter, int transSpeed) { textObj.Initialize(); if (textObj is GameText) { ((GameText)textObj).Text = text; ((GameText)textObj).Position = position; ((GameText)textObj).Enabled = enabled; ((GameText)textObj).Visible = visible; ((GameText)textObj).DrawAtCenter = drawAtCenter; } if (textObj is MenuText) { ((MenuText)textObj).TransitionSpeedInMilliseconds = transSpeed; } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Creates a text for testing. /// </summary> /// ------------------------------------------------------------------------------------ private void CreateTestText() { m_txt = m_servLoc.GetInstance<ITextFactory>().Create(); //Cache.LangProject.TextsOC.Add(m_txt); m_possTagList = Cache.LangProject.GetDefaultTextTagList(); m_stTxt = m_servLoc.GetInstance<IStTextFactory>().Create(); m_txt.ContentsOA = m_stTxt; m_txtPara = m_txt.ContentsOA.AddNewTextPara(null); // 0 1 2 3 4 5 6 7 8 // This is a test string for ReferenceAdjusterService tests. var hvoVernWs = Cache.DefaultVernWs; m_txtPara.Contents = TsStringUtils.MakeTss("This is a test string for ReferenceAdjusterService tests.", hvoVernWs); ParseText(); }
public override void Initialize() { CheckDisposed(); base.Initialize(); InstallVirtuals(@"Language Explorer\Configuration\Words\AreaConfiguration.xml", new string[] { "SIL.FieldWorks.IText.ParagraphSegmentsVirtualHandler", "SIL.FieldWorks.IText.OccurrencesInTextsVirtualHandler" }); // Try moving this up to Fixture Setup, since we don't plan on changing the text here. m_text1 = LoadTestText(@"LexText\Interlinear\ITextDllTests\ParagraphParserTestTexts.xml", 1, m_textsDefn); m_hvoPara = m_text1.ContentsOA.ParagraphsOS[1].Hvo; // First paragraph contains no text! ParseTestText(); m_tagChild = new TestTaggingChild(Cache); // This could change, but at least it gives a reasonably stable list to test from. m_textMarkupTags = m_tagChild.CreateDefaultListFromXML(); LoadTagListHvos(); }
private void FixtureSetupInternal() { //IWritingSystem wsEn = Cache.WritingSystemFactory.get_Engine("en"); // Setup default analysis ws //m_wsEn = Cache.ServiceLocator.GetInstance<ILgWritingSystemRepository>().GetObject(wsEn.WritingSystem); m_wsVern = Cache.DefaultVernWs; m_wsTrans = Cache.DefaultAnalWs; m_text = Cache.ServiceLocator.GetInstance<ITextFactory>().Create(); //Cache.LangProject.TextsOC.Add(m_text); var stText = Cache.ServiceLocator.GetInstance<IStTextFactory>().Create(); m_text.ContentsOA = stText; m_para = Cache.ServiceLocator.GetInstance<IScrTxtParaFactory>().CreateWithStyle(stText, ScrStyleNames.NormalParagraph); m_trans = m_para.GetOrCreateBT(); Cache.LangProject.TranslatedScriptureOA.UseScriptDigits = false; m_tsf = Cache.TsStrFactory; }
public TextControl(IPluginHost pluginHost, sFile file) { if (!IsSupported(file.id)) throw new NotSupportedException(); InitializeComponent(); this.pluginHost = pluginHost; this.id = file.id; this.fileName = System.IO.Path.GetFileNameWithoutExtension(file.name); itext = Create_IText(id); itext.Read(file.path); text = itext.Get_Text(); numBlock.Maximum = text.Length - 1; label3.Text = "of " + numBlock.Maximum.ToString(); numBlock_ValueChanged(null, null); }
internal override CommonCompilation CreateCompilation(IText code, string path, bool isInteractive, Session session, Type returnType, DiagnosticBag diagnostics) { Compilation previousSubmission = (Compilation) session.LastSubmission; IEnumerable<MetadataReference> referencesForCompilation = session.GetReferencesForCompilation(); ReadOnlyArray<string> namespacesForCompilation = session.GetNamespacesForCompilation(); ParseOptions options = isInteractive ? ScriptEngine.DefaultInteractive : ScriptEngine.DefaultScript; SyntaxTree syntaxTree = SyntaxTree.ParseText(code, path, options, new CancellationToken()); diagnostics.Add((IEnumerable<CommonDiagnostic>) syntaxTree.GetDiagnostics(new CancellationToken())); if (diagnostics.HasAnyErrors()) return (CommonCompilation) null; string assemblyName; string typeName; this.GenerateSubmissionId(out assemblyName, out typeName); Compilation submission = Compilation.CreateSubmission(assemblyName, new CompilationOptions(OutputKind.DynamicallyLinkedLibrary, (string) null, typeName, (IEnumerable<string>) namespacesForCompilation.ToList(), DebugInformationKind.None, false, true, false, true, (string) null, (string) null, new bool?(), 0, 0UL, Platform.AnyCPU, ReportWarning.Default, 4, (IReadOnlyDictionary<int, ReportWarning>) null, false, new SubsystemVersion()), syntaxTree, previousSubmission, referencesForCompilation, session.FileResolver, this.metadataFileProvider, returnType, session.HostObjectType); this.ValidateReferences((CommonCompilation) submission, diagnostics); if (diagnostics.HasAnyErrors()) return (CommonCompilation) null; else return (CommonCompilation) submission; }
public static CompilationUnitSyntax Apply(IText text, TextSpan span, out IEnumerable<SyntaxAnnotation> propertyAnnotations) { var document = GetDocument(text); document = PropertyAnnotater.Annotate(document, span, out propertyAnnotations); foreach (var propertyAnnotation in propertyAnnotations) { var propertyDeclaration = document.GetAnnotatedNode<PropertyDeclarationSyntax>(propertyAnnotation); document = document.ExpandProperty(propertyDeclaration); propertyDeclaration = document.GetAnnotatedNode<PropertyDeclarationSyntax>(propertyAnnotation); var classDeclaration = propertyDeclaration.FirstAncestorOrSelf<ClassDeclarationSyntax>(); document = document.ImplementINotifyPropertyChanged(classDeclaration); } var newRoot = document .Simplify(CodeAnnotations.Simplify) .Format(CodeAnnotations.Formatting) .GetSyntaxRoot(); return (CompilationUnitSyntax)newRoot; }
/// <summary> /// Initializes a new instance of the <see cref="TextsController"/> class. /// </summary> /// <param name="text">A service with access to text resources.</param> public TextsController(IText text) { _text = text; }
public Slash(IText text) { _text = text; }
internal TestableResourceHandler(AppConfig appConfig, BrowserSettings settings, IRequestFilter filter, ILogger logger, IText text) : base(appConfig, settings, filter, logger, text) { }
/// <summary> /// Initializes a new instance of <see cref="InferredName"/>. /// </summary> /// <param name="typeCache">Type cache without namespaces.</param> /// <param name="source">The name to infer.</param> /// <param name="handleDuplicatesIndex">If there are duplicate type names in an assembly, this index used to access a particular item from an array.</param> public InferredName(IScalar <IReadOnlyDictionary <string, Type[]> > typeCache, IText source, int handleDuplicatesIndex = 0) { _handleDuplicatesIndex = handleDuplicatesIndex; _typeCacheWithoutNamespace = new Cached <IReadOnlyDictionary <string, Type[]> >(typeCache); _source = source; }
public static void MapText(IButtonHandler handler, IText button) { handler.TypedNativeView?.UpdateTextPlainText(button); }
public ItemColor GetForeground(IText text) { var tb = WpfBlockHelper.GetTextBlock(text); return(GetItemColor(tb.Foreground)); }
public void VisitText(IText text) { Count += text.Properties.Text.Length; }
public void Deselect(IText text) { WpfBlockHelper.GetTextBlock(text).Foreground = WpfBlockFactory.NormalBrush; }
public void Select(IText text) { WpfBlockHelper.GetTextBlock(text).Foreground = WpfBlockFactory.SelectedBrush; }
public bool IsSelected(IText text) { var tb = WpfBlockHelper.GetTextBlock(text); return(tb.Foreground != WpfBlockFactory.SelectedBrush); }
public static TextBlock GetTextBlock(IText text) { return((text.Native as Grid).Children[0] as TextBlock); }
internal override CommonCompilation CreateCompilation(IText code, string path, bool isInteractive, Session session, Type returnType, DiagnosticBag diagnostics) { Debug.Assert(code != null && path != null && diagnostics != null); Compilation previousSubmission = (session != null) ? (Compilation)session.LastSubmission : null; IEnumerable <MetadataReference> references = GetReferences(session); ReadOnlyArray <string> usings = GetImportedNamespaces(session); // TODO (tomat): BaseDirectory should be a property on ScriptEngine? var fileResolver = Session.GetFileResolver(session, Directory.GetCurrentDirectory()); // parse: var parseOptions = isInteractive ? DefaultInteractive : DefaultScript; var tree = SyntaxTree.ParseText(code, path, parseOptions); diagnostics.Add(tree.GetDiagnostics()); if (diagnostics.HasAnyErrors()) { return(null); } // create compilation: string assemblyName, submissionTypeName; GenerateSubmissionId(out assemblyName, out submissionTypeName); var compilation = Compilation.CreateSubmission( assemblyName, new CompilationOptions( outputKind: OutputKind.DynamicallyLinkedLibrary, mainTypeName: null, scriptClassName: submissionTypeName, usings: usings.ToList(), optimize: false, // TODO (tomat) checkOverflow: true, // TODO (tomat) allowUnsafe: false, // TODO (tomat) cryptoKeyContainer: null, cryptoKeyFile: null, delaySign: null, fileAlignment: 0, baseAddress: 0L, platform: Platform.AnyCPU, generalWarningOption: ReportWarning.Default, warningLevel: 4, specificWarningOptions: null, highEntropyVirtualAddressSpace: false ), tree, previousSubmission, references, fileResolver, this.metadataFileProvider, returnType, (session != null) ? session.HostObjectType : null ); ValidateReferences(compilation, diagnostics); if (diagnostics.HasAnyErrors()) { return(null); } return(compilation); }
public I18nOperation(ILogger logger, IText text) { this.logger = logger; this.text = text; }
private void RecursionHtmlNode(string treeNode, INode htmlNode, bool siblingRequired) { if (htmlNode == null || treeNode == null) { return; } string current = treeNode; //string content; //current node if (htmlNode is ITag) { string nodeString = ""; ITag tag = (htmlNode as ITag); if (!tag.IsEndTag()) { nodeString = tag.TagName; if (tag.Attributes != null && tag.Attributes.Count > 0) { if (tag.Attributes["ID"] != null) { nodeString = nodeString + " { id=\"" + tag.Attributes["ID"].ToString() + "\" }"; } if (tag.Attributes["HREF"] != null) { nodeString = nodeString + " { href=\"" + tag.Attributes["HREF"].ToString() + "\" }"; } if (tag.Attributes["SIZE"] != null) { nodeString = nodeString + " { size=\"" + tag.Attributes["SIZE"].ToString() + "\" }"; } if (tag.Attributes["COLOR"] != null) { nodeString = nodeString + " { color=\"" + tag.Attributes["COLOR"].ToString() + "\" }"; } } } else { nodeString = tag.TagName + " End"; } current = nodeString; 节点列表.Add(current); } //获取节点间的内容 if (htmlNode.Children != null && htmlNode.Children.Count > 0) { this.RecursionHtmlNode(current, htmlNode.FirstChild, true); //content = htmlNode.FirstChild.GetText(); //节点列表.Add(content); } else if (!(htmlNode is ITag)) { if (htmlNode is IText) { IText tex = htmlNode as IText; current = tex.GetText(); current = current.Replace("\r\n", ""); current = current.Replace(" ", " "); byte[] utf8Bom = new byte[] { 239, 187, 191 }; current = current.Replace(PlatformTools.BS2String_UTF8(utf8Bom), ""); bool allIsSpace = true; for (int i = 0; i < current.Length; ++i) { if (current[i] != ' ') { allIsSpace = false; break; } } if (!string.IsNullOrEmpty(current) && current != "\t" && !allIsSpace) { 节点列表.Add(current); } } else { string typestr = htmlNode.GetType().ToString(); 节点列表.Add(typestr); } } //the sibling nodes if (siblingRequired) { INode sibling = htmlNode.NextSibling; while (sibling != null) { this.RecursionHtmlNode(treeNode, sibling, false); sibling = sibling.NextSibling; } } }
public ReplacedText(IText source, char old, char replace) { this.source = source; this.old = old; this.replace = replace; }
protected void AddText(IText text) { _texts[text.Id] = text; }
public BadCredentialViewModel(IText message) { Message = message.String(); }
public bool TryGetText(string id, out IText text) { return(_texts.TryGetValue(id, out text)); }
public TextManager(IText editor) { this.editor = editor; }
public static void UpdateFont(this TextBox platformControl, IText text, IFontManager fontManager) => platformControl.UpdateFont(text.Font, fontManager);
public void VisitText(IText text) { PlainText += text.ToString(); }
public void VisitText(IText text) { //Nothing to add }
/// <summary> /// Ctor. /// </summary> public Subtitle(IText text) { this.childs.Add(text); }
internal static void UpdateTextPlainText(this UILabel platformLabel, IText label) { platformLabel.Text = label.Text; }
public HoverTextEvent(IText source) { Source = source; }
public MessageBoxFactory(IText text) { this.text = text; }
public string GetText(IText text) { var tb = WpfBlockHelper.GetTextBlock(text); return(tb.Text); }
/// <summary> /// Adds a body to a request /// </summary> public Body(IText text) : this( new BytesOf(text) ) { }
/// <summary> /// Adds a body and its content type to a request. /// </summary> public Body(IText content, string contentType) : this( new BytesOf(content), contentType ) { }
public void VisitText(IText text) { var txt = text.Properties.Text; textList.Add(new Tuple <string, IText>(txt, text)); }