Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / MS / Internal / PtsHost / OptimalBreakSession.cs / 1 / OptimalBreakSession.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: OptimalBreakSession // // Description: OptimalBreakSession is unmanaged resouce handle to TextParagraphCache // // History: // 06/07/2005 : ghermann - created // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Windows; using System.Security; // SecurityCritical using System.Windows.Documents; using MS.Internal.Text; using MS.Internal.PtsHost.UnsafeNativeMethods; using System.Windows.Media.TextFormatting; namespace MS.Internal.PtsHost { // --------------------------------------------------------------------- // Break record for line - holds decoration information // --------------------------------------------------------------------- internal sealed class OptimalBreakSession : UnmanagedHandle { // ------------------------------------------------------------------ // Constructor. // // PtsContext - Context // TextParagraphCache - Contained line break // ----------------------------------------------------------------- internal OptimalBreakSession(TextParagraph textParagraph, TextParaClient textParaClient, TextParagraphCache TextParagraphCache, OptimalTextSource optimalTextSource) : base(textParagraph.PtsContext) { _textParagraph = textParagraph; _textParaClient = textParaClient; _textParagraphCache = TextParagraphCache; _optimalTextSource = optimalTextSource; } ////// Dispose the break session / paragraph cache /// public override void Dispose() { try { if(_textParagraphCache != null) { _textParagraphCache.Dispose(); } if(_optimalTextSource != null) { _optimalTextSource.Dispose(); } } finally { _textParagraphCache = null; _optimalTextSource = null; } base.Dispose(); } #region Internal Properties internal TextParagraphCache TextParagraphCache { get { return _textParagraphCache; } } internal TextParagraph TextParagraph { get { return _textParagraph; } } internal TextParaClient TextParaClient { get { return _textParaClient; } } internal OptimalTextSource OptimalTextSource { get { return _optimalTextSource; } } #endregion Internal Properties #region Private Fields private TextParagraphCache _textParagraphCache; private TextParagraph _textParagraph; private TextParaClient _textParaClient; private OptimalTextSource _optimalTextSource; #endregion Private Fields } // ---------------------------------------------------------------------- // LineBreakpoint - Unmanaged handle for TextBreakpoint / optimal break session // ---------------------------------------------------------------------- internal sealed class LineBreakpoint : UnmanagedHandle { // ----------------------------------------------------------------- // Constructor. // // PtsContext - Context // TextBreakpoint - Contained breakpoint // ------------------------------------------------------------------ internal LineBreakpoint(OptimalBreakSession optimalBreakSession, TextBreakpoint textBreakpoint) : base(optimalBreakSession.PtsContext) { _textBreakpoint = textBreakpoint; _optimalBreakSession = optimalBreakSession; } ////// Dispose the text breakpoint /// public override void Dispose() { if(_textBreakpoint != null) { _textBreakpoint.Dispose(); } base.Dispose(); } #region Internal Properties internal OptimalBreakSession OptimalBreakSession { get { return _optimalBreakSession; } } #endregion Internal Properties #region Private Fields private TextBreakpoint _textBreakpoint; private OptimalBreakSession _optimalBreakSession; #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. // // File: OptimalBreakSession // // Description: OptimalBreakSession is unmanaged resouce handle to TextParagraphCache // // History: // 06/07/2005 : ghermann - created // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Windows; using System.Security; // SecurityCritical using System.Windows.Documents; using MS.Internal.Text; using MS.Internal.PtsHost.UnsafeNativeMethods; using System.Windows.Media.TextFormatting; namespace MS.Internal.PtsHost { // --------------------------------------------------------------------- // Break record for line - holds decoration information // --------------------------------------------------------------------- internal sealed class OptimalBreakSession : UnmanagedHandle { // ------------------------------------------------------------------ // Constructor. // // PtsContext - Context // TextParagraphCache - Contained line break // ----------------------------------------------------------------- internal OptimalBreakSession(TextParagraph textParagraph, TextParaClient textParaClient, TextParagraphCache TextParagraphCache, OptimalTextSource optimalTextSource) : base(textParagraph.PtsContext) { _textParagraph = textParagraph; _textParaClient = textParaClient; _textParagraphCache = TextParagraphCache; _optimalTextSource = optimalTextSource; } ////// Dispose the break session / paragraph cache /// public override void Dispose() { try { if(_textParagraphCache != null) { _textParagraphCache.Dispose(); } if(_optimalTextSource != null) { _optimalTextSource.Dispose(); } } finally { _textParagraphCache = null; _optimalTextSource = null; } base.Dispose(); } #region Internal Properties internal TextParagraphCache TextParagraphCache { get { return _textParagraphCache; } } internal TextParagraph TextParagraph { get { return _textParagraph; } } internal TextParaClient TextParaClient { get { return _textParaClient; } } internal OptimalTextSource OptimalTextSource { get { return _optimalTextSource; } } #endregion Internal Properties #region Private Fields private TextParagraphCache _textParagraphCache; private TextParagraph _textParagraph; private TextParaClient _textParaClient; private OptimalTextSource _optimalTextSource; #endregion Private Fields } // ---------------------------------------------------------------------- // LineBreakpoint - Unmanaged handle for TextBreakpoint / optimal break session // ---------------------------------------------------------------------- internal sealed class LineBreakpoint : UnmanagedHandle { // ----------------------------------------------------------------- // Constructor. // // PtsContext - Context // TextBreakpoint - Contained breakpoint // ------------------------------------------------------------------ internal LineBreakpoint(OptimalBreakSession optimalBreakSession, TextBreakpoint textBreakpoint) : base(optimalBreakSession.PtsContext) { _textBreakpoint = textBreakpoint; _optimalBreakSession = optimalBreakSession; } ////// Dispose the text breakpoint /// public override void Dispose() { if(_textBreakpoint != null) { _textBreakpoint.Dispose(); } base.Dispose(); } #region Internal Properties internal OptimalBreakSession OptimalBreakSession { get { return _optimalBreakSession; } } #endregion Internal Properties #region Private Fields private TextBreakpoint _textBreakpoint; private OptimalBreakSession _optimalBreakSession; #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
- ListViewDeleteEventArgs.cs
- XmlSchemaValidator.cs
- RoutedEventConverter.cs
- TimelineClockCollection.cs
- HtmlElement.cs
- SqlSelectStatement.cs
- WebBrowserEvent.cs
- ActivityCompletionCallbackWrapper.cs
- LinearGradientBrush.cs
- IsolatedStorageFileStream.cs
- unitconverter.cs
- XmlSchemaSimpleTypeRestriction.cs
- BindingNavigator.cs
- ClientBuildManager.cs
- DispatchOperationRuntime.cs
- StatusBarItemAutomationPeer.cs
- EventPrivateKey.cs
- LayoutEditorPart.cs
- Parallel.cs
- Popup.cs
- KnownBoxes.cs
- XDeferredAxisSource.cs
- ProfileParameter.cs
- SystemIPInterfaceProperties.cs
- DataBoundLiteralControl.cs
- EnumMemberAttribute.cs
- SystemIPv4InterfaceProperties.cs
- _AutoWebProxyScriptEngine.cs
- BasicExpressionVisitor.cs
- ToggleProviderWrapper.cs
- KnownTypesProvider.cs
- CustomCategoryAttribute.cs
- SurrogateChar.cs
- DataKey.cs
- SemanticKeyElement.cs
- PageContent.cs
- TranslateTransform3D.cs
- QueryTaskGroupState.cs
- SchemaMapping.cs
- ClientRoleProvider.cs
- SchemaCollectionCompiler.cs
- HandlerElement.cs
- RepeatInfo.cs
- XmlSchemaResource.cs
- ellipse.cs
- DiscreteKeyFrames.cs
- BamlReader.cs
- DispatchOperation.cs
- DrawingGroupDrawingContext.cs
- SqlDataSourceCustomCommandEditor.cs
- ErrorFormatterPage.cs
- GlobalEventManager.cs
- ComPlusThreadInitializer.cs
- ContextBase.cs
- EndpointAddressMessageFilterTable.cs
- TextEffectCollection.cs
- RegisteredDisposeScript.cs
- ToolStripLabel.cs
- TextParagraphProperties.cs
- ClosableStream.cs
- COAUTHINFO.cs
- LicenseManager.cs
- ErrorsHelper.cs
- ListDictionaryInternal.cs
- PerformanceCounterManager.cs
- IntegerFacetDescriptionElement.cs
- StreamMarshaler.cs
- Connection.cs
- InvalidOperationException.cs
- TimelineGroup.cs
- GridViewUpdateEventArgs.cs
- ObjectPersistData.cs
- CodeTypeConstructor.cs
- TdsParserStateObject.cs
- ImageClickEventArgs.cs
- XmlSchemaInfo.cs
- EndpointDiscoveryMetadata.cs
- DecoderReplacementFallback.cs
- ItemList.cs
- ContentType.cs
- Int32Storage.cs
- QueryExpr.cs
- PrivilegedConfigurationManager.cs
- QueryCorrelationInitializer.cs
- RawAppCommandInputReport.cs
- TabControlAutomationPeer.cs
- TypefaceCollection.cs
- Pts.cs
- ArgumentException.cs
- TransactedBatchContext.cs
- MessageDecoder.cs
- PolyLineSegment.cs
- TraceHwndHost.cs
- DateTimePicker.cs
- LinearKeyFrames.cs
- EntityWrapper.cs
- ObjectQueryState.cs
- SafeRightsManagementEnvironmentHandle.cs
- TextEffect.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs