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
- MeasurementDCInfo.cs
- DefaultValidator.cs
- AudienceUriMode.cs
- PolicyStatement.cs
- DataPagerFieldCollection.cs
- ObjectDataSourceMethodEventArgs.cs
- StateChangeEvent.cs
- RoleServiceManager.cs
- diagnosticsswitches.cs
- ResponseBodyWriter.cs
- SamlSecurityTokenAuthenticator.cs
- _Events.cs
- SettingsPropertyWrongTypeException.cs
- MsmqOutputSessionChannel.cs
- FieldReference.cs
- FontCollection.cs
- ListBindingConverter.cs
- JoinGraph.cs
- SizeAnimationClockResource.cs
- Delegate.cs
- RuntimeVariablesExpression.cs
- SQLInt64.cs
- XmlSchemaGroupRef.cs
- GeneralTransform3DGroup.cs
- GridView.cs
- DiscriminatorMap.cs
- Int64AnimationBase.cs
- ContextMenuStripActionList.cs
- DocumentViewer.cs
- SslSecurityTokenParameters.cs
- PrivateFontCollection.cs
- XsltConvert.cs
- XmlSchemaRedefine.cs
- SQLSingle.cs
- UnsafeNativeMethods.cs
- _SingleItemRequestCache.cs
- RenderData.cs
- Site.cs
- RawKeyboardInputReport.cs
- CompletedAsyncResult.cs
- ButtonAutomationPeer.cs
- XamlTemplateSerializer.cs
- System.Data_BID.cs
- SiteMapNodeItemEventArgs.cs
- XmlSchemaException.cs
- NTAccount.cs
- SendingRequestEventArgs.cs
- GridViewSelectEventArgs.cs
- securitymgrsite.cs
- SafeNativeMethods.cs
- ServiceBuildProvider.cs
- AssemblySettingAttributes.cs
- Adorner.cs
- InboundActivityHelper.cs
- FontSource.cs
- XmlSerializerAssemblyAttribute.cs
- DataSysAttribute.cs
- Vector.cs
- DependencyObjectType.cs
- SafeSecurityHandles.cs
- OptimalBreakSession.cs
- HtmlInputSubmit.cs
- DataGridPagerStyle.cs
- CodeObjectCreateExpression.cs
- TdsEnums.cs
- DbBuffer.cs
- Rotation3DAnimationBase.cs
- ListenerConnectionDemuxer.cs
- DataGridRowDetailsEventArgs.cs
- BaseCodePageEncoding.cs
- IntegerCollectionEditor.cs
- TrustSection.cs
- Part.cs
- EntityDataSourceReferenceGroup.cs
- InternalSendMessage.cs
- StringValidatorAttribute.cs
- CodeCastExpression.cs
- ToolStripLabel.cs
- ScrollProviderWrapper.cs
- Color.cs
- ObjectViewEntityCollectionData.cs
- RepeatBehavior.cs
- UnsafeMethods.cs
- SoapObjectInfo.cs
- NavigatorOutput.cs
- PrintControllerWithStatusDialog.cs
- RegexWorker.cs
- ContextProperty.cs
- BulletedListEventArgs.cs
- ComPlusAuthorization.cs
- SecurityException.cs
- DataPager.cs
- SemanticResultKey.cs
- SyndicationDeserializer.cs
- Drawing.cs
- TreeBuilderXamlTranslator.cs
- Stacktrace.cs
- Utility.cs
- NavigateEvent.cs
- ApplicationFileParser.cs