Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- XmlMembersMapping.cs
- EntityParameter.cs
- Speller.cs
- WinFormsSpinner.cs
- InputBuffer.cs
- HideDisabledControlAdapter.cs
- SqlDataReaderSmi.cs
- ChangeProcessor.cs
- TextTreeDeleteContentUndoUnit.cs
- EntityDataSourceQueryBuilder.cs
- SynchronizationFilter.cs
- Attribute.cs
- UniqueIdentifierService.cs
- TagMapCollection.cs
- WebPartVerbsEventArgs.cs
- ExpressionBindings.cs
- WorkflowServiceHostFactory.cs
- BaseDataList.cs
- FieldAccessException.cs
- WebPartConnectionsEventArgs.cs
- XmlNode.cs
- Knowncolors.cs
- CryptoApi.cs
- SortQuery.cs
- MdImport.cs
- SystemNetworkInterface.cs
- ColorDialog.cs
- TableRow.cs
- TraceContextRecord.cs
- FrameworkElement.cs
- FixedBufferAttribute.cs
- EmitterCache.cs
- Comparer.cs
- PasswordBoxAutomationPeer.cs
- FrameworkTextComposition.cs
- TableRowCollection.cs
- UnsafeNativeMethods.cs
- DispatchOperationRuntime.cs
- WebPartEditorApplyVerb.cs
- SettingsPropertyValue.cs
- ItemsPresenter.cs
- MergeLocalizationDirectives.cs
- StatusStrip.cs
- FileInfo.cs
- MailWriter.cs
- StringReader.cs
- OutputCacheProfile.cs
- ADMembershipUser.cs
- WebDescriptionAttribute.cs
- Documentation.cs
- SplitterEvent.cs
- CreateUserErrorEventArgs.cs
- SqlMetaData.cs
- XmlBinaryWriter.cs
- XPathDocument.cs
- UnauthorizedAccessException.cs
- SafeMILHandle.cs
- NonSerializedAttribute.cs
- SpeechRecognizer.cs
- HtmlAnchor.cs
- ServiceThrottlingBehavior.cs
- GradientStopCollection.cs
- CodeDOMProvider.cs
- DataGridViewUtilities.cs
- InternalSafeNativeMethods.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- SystemInfo.cs
- HttpCapabilitiesEvaluator.cs
- ToolBarOverflowPanel.cs
- HttpHandlerAction.cs
- WebBrowserProgressChangedEventHandler.cs
- QueryContinueDragEventArgs.cs
- XamlTemplateSerializer.cs
- SystemSounds.cs
- InvalidFilterCriteriaException.cs
- LongSumAggregationOperator.cs
- AssemblyName.cs
- UiaCoreApi.cs
- OutputCacheProviderCollection.cs
- TextClipboardData.cs
- KeyboardEventArgs.cs
- PlanCompiler.cs
- ListenerConfig.cs
- PasswordDeriveBytes.cs
- MemberInfoSerializationHolder.cs
- ColorBlend.cs
- ConditionalWeakTable.cs
- SqlException.cs
- SrgsOneOf.cs
- TripleDESCryptoServiceProvider.cs
- DataPagerFieldCommandEventArgs.cs
- ProxyFragment.cs
- PropertyChangedEventManager.cs
- SelfIssuedAuthAsymmetricKey.cs
- SizeF.cs
- HttpTransportBindingElement.cs
- PictureBox.cs
- NavigationCommands.cs
- PackageRelationship.cs
- RotationValidation.cs