Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- RemoteWebConfigurationHostStream.cs
- SiteMapSection.cs
- DataGridViewControlCollection.cs
- ArraySegment.cs
- BoolExpressionVisitors.cs
- DiscoveryClientRequestChannel.cs
- CallbackTimeoutsBehavior.cs
- RoutedPropertyChangedEventArgs.cs
- DescendantBaseQuery.cs
- PagesChangedEventArgs.cs
- Helpers.cs
- ImageKeyConverter.cs
- GlyphRunDrawing.cs
- AutomationElementCollection.cs
- ListenerSessionConnection.cs
- ApplyImportsAction.cs
- ObjectContext.cs
- TextEditorSelection.cs
- GZipUtils.cs
- SurrogateChar.cs
- DefaultHttpHandler.cs
- DiscoveryDocumentReference.cs
- TableCellCollection.cs
- Rule.cs
- TimersDescriptionAttribute.cs
- KeyConstraint.cs
- StringUtil.cs
- DecimalAnimationBase.cs
- CachingHintValidation.cs
- SecurityDescriptor.cs
- XmlReflectionImporter.cs
- ZipArchive.cs
- D3DImage.cs
- SimpleBitVector32.cs
- WindowsFormsHostAutomationPeer.cs
- InternalCache.cs
- BindingExpressionUncommonField.cs
- X509Utils.cs
- ConnectionPointConverter.cs
- PrinterResolution.cs
- TableSectionStyle.cs
- Serializer.cs
- WorkflowInstanceAbortedRecord.cs
- SineEase.cs
- DiagnosticsConfiguration.cs
- HierarchicalDataSourceControl.cs
- GroupByExpressionRewriter.cs
- BindingNavigator.cs
- InkCanvasInnerCanvas.cs
- FileSystemWatcher.cs
- FrameworkElement.cs
- CodeDomLoader.cs
- RegisteredScript.cs
- BitFlagsGenerator.cs
- ColorAnimationUsingKeyFrames.cs
- RemotingConfigParser.cs
- ControlPropertyNameConverter.cs
- IsolatedStorageFileStream.cs
- CqlIdentifiers.cs
- PermissionSetEnumerator.cs
- ViewCellSlot.cs
- DPTypeDescriptorContext.cs
- WebPartMovingEventArgs.cs
- UnconditionalPolicy.cs
- RenameRuleObjectDialog.Designer.cs
- Serializer.cs
- SecurityElement.cs
- AdRotator.cs
- SmiGettersStream.cs
- MetadataPropertyvalue.cs
- SecurityRuntime.cs
- ResolveCompletedEventArgs.cs
- DetailsViewPagerRow.cs
- SequenceDesignerAccessibleObject.cs
- TextEvent.cs
- MemberPathMap.cs
- BuiltInExpr.cs
- Visual3DCollection.cs
- MachineKeyValidationConverter.cs
- OdbcCommandBuilder.cs
- EditorPartCollection.cs
- HttpModuleActionCollection.cs
- ProcessModelInfo.cs
- MatrixTransform3D.cs
- WebBrowser.cs
- TextTreeFixupNode.cs
- Pen.cs
- Win32KeyboardDevice.cs
- TextLineResult.cs
- HotSpot.cs
- Color.cs
- ReadOnlyDataSource.cs
- DescriptionCreator.cs
- Column.cs
- SqlUtils.cs
- ProgressBarHighlightConverter.cs
- XDeferredAxisSource.cs
- StylusButton.cs
- KeysConverter.cs
- Overlapped.cs