Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- TextHidden.cs
- DrawingAttributeSerializer.cs
- ErrorBehavior.cs
- StateChangeEvent.cs
- ConfigurationUtility.cs
- LinqExpressionNormalizer.cs
- DesignerTransaction.cs
- MessageQueueException.cs
- SessionEndedEventArgs.cs
- TextEditorContextMenu.cs
- ObjectDataSource.cs
- PriorityQueue.cs
- CodeValidator.cs
- DataGridViewHitTestInfo.cs
- SqlProvider.cs
- InputReportEventArgs.cs
- WorkflowServiceHostFactory.cs
- MobileRedirect.cs
- SingleAnimationUsingKeyFrames.cs
- NavigationCommands.cs
- ThreadAttributes.cs
- Tuple.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- Decoder.cs
- NetTcpSection.cs
- XmlCharCheckingWriter.cs
- CallbackValidator.cs
- SqlRewriteScalarSubqueries.cs
- CollectionBase.cs
- BaseInfoTable.cs
- SelectionWordBreaker.cs
- IDReferencePropertyAttribute.cs
- Serializer.cs
- ViewRendering.cs
- HttpContext.cs
- ExtenderProviderService.cs
- ServiceContractGenerationContext.cs
- XPathExpr.cs
- LingerOption.cs
- FunctionDetailsReader.cs
- HtmlShimManager.cs
- InputEventArgs.cs
- MutableAssemblyCacheEntry.cs
- Grid.cs
- PageFunction.cs
- StorageAssociationTypeMapping.cs
- TcpClientChannel.cs
- ComponentChangingEvent.cs
- SqlInternalConnection.cs
- BindingGroup.cs
- WindowInteropHelper.cs
- MostlySingletonList.cs
- CompModHelpers.cs
- InputDevice.cs
- EntityChangedParams.cs
- SqlProvider.cs
- PropertyPushdownHelper.cs
- SqlInternalConnectionSmi.cs
- DelegatingTypeDescriptionProvider.cs
- FilterException.cs
- SelectionPatternIdentifiers.cs
- DropSourceBehavior.cs
- BindingWorker.cs
- controlskin.cs
- ServiceDescriptionImporter.cs
- UnsafeNativeMethods.cs
- ColorAnimationUsingKeyFrames.cs
- InputLanguageEventArgs.cs
- OperationCanceledException.cs
- Attributes.cs
- UserMapPath.cs
- Attribute.cs
- UnhandledExceptionEventArgs.cs
- COSERVERINFO.cs
- ResourceKey.cs
- SessionStateModule.cs
- SimpleMailWebEventProvider.cs
- TraceListener.cs
- Hex.cs
- XmlValidatingReader.cs
- CalendarButton.cs
- TextTreePropertyUndoUnit.cs
- CodeTypeDeclarationCollection.cs
- InvokeMemberBinder.cs
- BCryptHashAlgorithm.cs
- MaskedTextBox.cs
- HttpCacheParams.cs
- TextSchema.cs
- FileController.cs
- EditorAttribute.cs
- KeyEventArgs.cs
- PermissionSetTriple.cs
- MembershipSection.cs
- HttpFileCollection.cs
- StringAttributeCollection.cs
- PageVisual.cs
- ObjectAnimationUsingKeyFrames.cs
- WindowsListViewScroll.cs
- ServicesUtilities.cs
- GlyphRun.cs