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
- DesignOnlyAttribute.cs
- XmlEntity.cs
- XmlObjectSerializerWriteContextComplex.cs
- BulletedList.cs
- OrderByLifter.cs
- SqlStream.cs
- UshortList2.cs
- PersistChildrenAttribute.cs
- HtmlInputRadioButton.cs
- SimpleFileLog.cs
- PassportPrincipal.cs
- WasHttpModulesInstallComponent.cs
- ContentHostHelper.cs
- TreeView.cs
- NamespaceCollection.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- SafePointer.cs
- WFItemsToSpacerVisibility.cs
- DocumentViewerAutomationPeer.cs
- ModelPropertyImpl.cs
- WebServiceHandler.cs
- securitycriticaldataformultiplegetandset.cs
- PartBasedPackageProperties.cs
- StringToken.cs
- ImmutableCollection.cs
- RewritingProcessor.cs
- SqlDeflator.cs
- AppearanceEditorPart.cs
- EntityDataSourceContainerNameItem.cs
- ContentPosition.cs
- LoginCancelEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- MetadataExchangeClient.cs
- ContextProperty.cs
- ViewGenerator.cs
- ProgramPublisher.cs
- CompilerParameters.cs
- RuntimeIdentifierPropertyAttribute.cs
- XhtmlConformanceSection.cs
- PagesChangedEventArgs.cs
- CopyEncoder.cs
- DefaultShape.cs
- TimerExtension.cs
- PersonalizationState.cs
- TabControl.cs
- WebEvents.cs
- InternalConfigHost.cs
- AuthStoreRoleProvider.cs
- UserNameSecurityTokenProvider.cs
- DriveInfo.cs
- SafePointer.cs
- _NtlmClient.cs
- Span.cs
- ResourcesBuildProvider.cs
- CursorConverter.cs
- DbDataAdapter.cs
- LinqDataSourceSelectEventArgs.cs
- BitmapFrame.cs
- ControlBuilder.cs
- SamlConstants.cs
- ProgressBarBrushConverter.cs
- Attribute.cs
- XmlConvert.cs
- WebPartEditorApplyVerb.cs
- BroadcastEventHelper.cs
- EventLogPermission.cs
- EndpointInfoCollection.cs
- BinHexDecoder.cs
- HttpProfileGroupBase.cs
- FilteredReadOnlyMetadataCollection.cs
- TrackingLocationCollection.cs
- DataSourceCache.cs
- WebBrowserBase.cs
- SqlClientFactory.cs
- RelOps.cs
- ShaperBuffers.cs
- SettingsAttributeDictionary.cs
- ConfigurationManagerInternal.cs
- NativeMethodsCLR.cs
- DataSourceUtil.cs
- Comparer.cs
- QueryRelOp.cs
- DynamicPhysicalDiscoSearcher.cs
- ReservationCollection.cs
- NumberFunctions.cs
- LogExtent.cs
- SolidBrush.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ProfileProvider.cs
- UnionExpr.cs
- ModuleElement.cs
- DataSourceXmlSubItemAttribute.cs
- HttpModulesInstallComponent.cs
- CacheMemory.cs
- HandlerMappingMemo.cs
- activationcontext.cs
- ConditionCollection.cs
- DbConnectionPoolOptions.cs
- DetailsViewActionList.cs
- DoubleKeyFrameCollection.cs