Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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 : [....] - 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
- DotNetATv1WindowsLogEntrySerializer.cs
- SmtpReplyReader.cs
- QilGenerator.cs
- KeyedCollection.cs
- ConstraintCollection.cs
- SponsorHelper.cs
- CustomAssemblyResolver.cs
- DataSourceConverter.cs
- ContentPlaceHolder.cs
- MessageBox.cs
- ContentPlaceHolder.cs
- TraceFilter.cs
- Sequence.cs
- LowerCaseStringConverter.cs
- ComContractElementCollection.cs
- WebControlAdapter.cs
- EncryptedKey.cs
- AttributeData.cs
- CornerRadiusConverter.cs
- DataGridSortCommandEventArgs.cs
- UserControlAutomationPeer.cs
- DataServiceProcessingPipeline.cs
- HttpValueCollection.cs
- PrintSystemException.cs
- ObjectQueryState.cs
- ObjectQueryProvider.cs
- SynthesizerStateChangedEventArgs.cs
- XmlObjectSerializerReadContextComplex.cs
- Int64AnimationBase.cs
- CollectionsUtil.cs
- DelegateHelpers.Generated.cs
- ipaddressinformationcollection.cs
- OpenFileDialog.cs
- ConnectivityStatus.cs
- PassportAuthenticationEventArgs.cs
- DesignerValidatorAdapter.cs
- DisposableCollectionWrapper.cs
- diagnosticsswitches.cs
- InfiniteIntConverter.cs
- GridViewDeleteEventArgs.cs
- FormsAuthenticationUser.cs
- TextRange.cs
- DrawListViewSubItemEventArgs.cs
- JsonReaderWriterFactory.cs
- BrushConverter.cs
- PeerCollaborationPermission.cs
- XmlObjectSerializerReadContextComplex.cs
- SqlReorderer.cs
- AnimationLayer.cs
- Expression.cs
- invalidudtexception.cs
- GridViewEditEventArgs.cs
- HttpListenerRequest.cs
- XsdDuration.cs
- ThreadStaticAttribute.cs
- WebPartHelpVerb.cs
- TypedDataSetSchemaImporterExtension.cs
- EntityDataSourceWizardForm.cs
- CancellationToken.cs
- DataGridViewCellStateChangedEventArgs.cs
- CoreSwitches.cs
- ActivityCodeDomSerializationManager.cs
- ConfigDefinitionUpdates.cs
- XPathNode.cs
- MimeFormatter.cs
- SecurityProtocolCorrelationState.cs
- HttpModule.cs
- BufferedGraphicsManager.cs
- ElementProxy.cs
- XmlUtf8RawTextWriter.cs
- MemoryFailPoint.cs
- LinqDataSourceEditData.cs
- VarRefManager.cs
- SystemThemeKey.cs
- SolidColorBrush.cs
- UnmanagedMemoryStreamWrapper.cs
- ReadContentAsBinaryHelper.cs
- HttpCookie.cs
- ConcurrencyBehavior.cs
- Path.cs
- Tracking.cs
- CompilerWrapper.cs
- WebPartCancelEventArgs.cs
- DocumentPageViewAutomationPeer.cs
- CapabilitiesRule.cs
- XmlSchemaAnyAttribute.cs
- XmlText.cs
- ButtonAutomationPeer.cs
- DecoderFallback.cs
- CryptographicAttribute.cs
- ExternalCalls.cs
- ADMembershipUser.cs
- BamlResourceContent.cs
- ExtentKey.cs
- MailWebEventProvider.cs
- SpnEndpointIdentityExtension.cs
- WebHeaderCollection.cs
- FormViewModeEventArgs.cs
- AncillaryOps.cs
- IisTraceListener.cs