Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / MS / Internal / IO / Packaging / fixedPageContentExtractor.cs / 1 / fixedPageContentExtractor.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Given a DOM node for a fixed page, enumerates its text content. // // History: // 05/11/2004: JohnLarc: Initial implementation //--------------------------------------------------------------------------- using System; using System.Xml; namespace MS.Internal.IO.Packaging { ////// Implements a sequence of (textContent, precedingDelimiter) pairs for /// a fixed page node. /// internal class FixedPageContentExtractor { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Initialize a FixedPageContentExtractor from a DOM node. /// internal FixedPageContentExtractor(XmlNode fixedPage) { _fixedPageInfo = new XmlFixedPageInfo(fixedPage); _nextGlyphRun = 0; } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods ////// Return the content of the next glyph run, with a boolean indication /// whether it is separated by a space form the preceding glyph run. /// internal string NextGlyphContent(out bool inline, out uint lcid) { // Right now, we use the simplest possible heuristic for // spacing glyph runs: All pairs of adjacent glyph runs are assumed // to be separated by a word break. inline = false; lcid = 0; // End of page? if (_nextGlyphRun >= _fixedPageInfo.GlyphRunCount) { return null; } // Retrieve inline, lcid and return value from the next glyph run info. GlyphRunInfo glyphRunInfo = _fixedPageInfo.GlyphRunAtPosition(_nextGlyphRun); lcid = glyphRunInfo.LanguageID; // Point to the next glyph run for the next call and return. ++_nextGlyphRun; return glyphRunInfo.UnicodeString; } #endregion Internal Methods //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ #region Internal Properties ////// Indicates whether no more content can be returned. /// internal bool AtEndOfPage { get { return _nextGlyphRun >= _fixedPageInfo.GlyphRunCount; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private XmlFixedPageInfo _fixedPageInfo; private int _nextGlyphRun; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Given a DOM node for a fixed page, enumerates its text content. // // History: // 05/11/2004: JohnLarc: Initial implementation //--------------------------------------------------------------------------- using System; using System.Xml; namespace MS.Internal.IO.Packaging { ////// Implements a sequence of (textContent, precedingDelimiter) pairs for /// a fixed page node. /// internal class FixedPageContentExtractor { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Initialize a FixedPageContentExtractor from a DOM node. /// internal FixedPageContentExtractor(XmlNode fixedPage) { _fixedPageInfo = new XmlFixedPageInfo(fixedPage); _nextGlyphRun = 0; } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods ////// Return the content of the next glyph run, with a boolean indication /// whether it is separated by a space form the preceding glyph run. /// internal string NextGlyphContent(out bool inline, out uint lcid) { // Right now, we use the simplest possible heuristic for // spacing glyph runs: All pairs of adjacent glyph runs are assumed // to be separated by a word break. inline = false; lcid = 0; // End of page? if (_nextGlyphRun >= _fixedPageInfo.GlyphRunCount) { return null; } // Retrieve inline, lcid and return value from the next glyph run info. GlyphRunInfo glyphRunInfo = _fixedPageInfo.GlyphRunAtPosition(_nextGlyphRun); lcid = glyphRunInfo.LanguageID; // Point to the next glyph run for the next call and return. ++_nextGlyphRun; return glyphRunInfo.UnicodeString; } #endregion Internal Methods //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ #region Internal Properties ////// Indicates whether no more content can be returned. /// internal bool AtEndOfPage { get { return _nextGlyphRun >= _fixedPageInfo.GlyphRunCount; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private XmlFixedPageInfo _fixedPageInfo; private int _nextGlyphRun; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlErrorCollection.cs
- TextBlock.cs
- HuffCodec.cs
- ValidationSummary.cs
- TemplatedWizardStep.cs
- InfoCardMasterKey.cs
- _ChunkParse.cs
- IISMapPath.cs
- InfoCardSymmetricCrypto.cs
- CodeTypeOfExpression.cs
- DocumentApplicationJournalEntry.cs
- ValidationHelper.cs
- RowSpanVector.cs
- ThaiBuddhistCalendar.cs
- SrgsRulesCollection.cs
- GroupStyle.cs
- GridItemCollection.cs
- WindowsFont.cs
- TransformConverter.cs
- Size3DValueSerializer.cs
- ReadOnlyDictionary.cs
- PropertyPushdownHelper.cs
- CellIdBoolean.cs
- DesignerView.cs
- ActivitySurrogate.cs
- PropertySegmentSerializer.cs
- XmlAtomicValue.cs
- Empty.cs
- ImageDrawing.cs
- CompositeTypefaceMetrics.cs
- SimpleFieldTemplateFactory.cs
- TerminatorSinks.cs
- UpDownBase.cs
- DirectoryInfo.cs
- OperandQuery.cs
- ClipboardData.cs
- CodeStatementCollection.cs
- AspNetRouteServiceHttpHandler.cs
- AppModelKnownContentFactory.cs
- ColorConverter.cs
- TextPointer.cs
- SchemaNamespaceManager.cs
- TextDpi.cs
- SizeAnimation.cs
- figurelength.cs
- XamlTypeMapper.cs
- PostBackTrigger.cs
- LockCookie.cs
- elementinformation.cs
- ExcludePathInfo.cs
- TemplatedMailWebEventProvider.cs
- PerspectiveCamera.cs
- Rules.cs
- XmlIgnoreAttribute.cs
- TextServicesCompartmentEventSink.cs
- AspNetHostingPermission.cs
- TransformPatternIdentifiers.cs
- Geometry.cs
- ImageConverter.cs
- CustomAttributeFormatException.cs
- DoubleLinkList.cs
- ReadOnlyPropertyMetadata.cs
- _TransmitFileOverlappedAsyncResult.cs
- CodeRegionDirective.cs
- Timer.cs
- RijndaelManagedTransform.cs
- DbProviderFactory.cs
- CodeTypeOfExpression.cs
- XmlLanguageConverter.cs
- OleDbError.cs
- TemplatedAdorner.cs
- ReachSerializerAsync.cs
- SqlUnionizer.cs
- WebPartEditVerb.cs
- ExtractCollection.cs
- TableLayoutCellPaintEventArgs.cs
- ConfigurationSettings.cs
- ToolStripRenderer.cs
- Misc.cs
- XmlEntity.cs
- IsolationInterop.cs
- CompilerScopeManager.cs
- Point3DAnimation.cs
- MenuAutoFormat.cs
- NumericUpDownAcceleration.cs
- ADRoleFactory.cs
- KeyNotFoundException.cs
- ReadOnlyDataSourceView.cs
- SignedXmlDebugLog.cs
- CharacterMetrics.cs
- VariableAction.cs
- SafeHandles.cs
- DataObjectPastingEventArgs.cs
- AlternateViewCollection.cs
- BitmapEffectInput.cs
- XamlSerializer.cs
- BuildProvidersCompiler.cs
- CompressEmulationStream.cs
- Funcletizer.cs
- MetadataSource.cs