Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Controls / Primitives / LayoutInformation.cs / 1 / LayoutInformation.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2005 // // File: LayoutInformation // Spec: http://team/sites/Avalon/Specs/LayoutInformation%20class.doc //----------------------------------------------------------------------------- using System; using System.Windows.Media; using System.Windows.Threading; namespace System.Windows.Controls.Primitives { ////// This interface exposes additional layout information not exposed otherwise on FrameworkElement. /// This information is mostly used by the designer programs to produce additional visual clues for the user /// during interactive editing of the elements and layout properties. /// public static class LayoutInformation { private static void CheckArgument(FrameworkElement element) { if (element == null) { throw new ArgumentNullException("element"); } } ////// Returns the rectangle that represents Layout Slot - the layout partition reserved for the /// child by the layout parent. This info is in the coordinte system of the layout parent. /// public static Rect GetLayoutSlot(FrameworkElement element) { CheckArgument(element); return element.PreviousArrangeRect; } ////// Returns a geometry which was computed by layout for the child. This is generally a visible region of the child. /// Layout can compute automatic clip region when the child is larger then layout constraints or has ClipToBounds /// property set. Note that because of LayoutTransform, this could be a non-rectangular geometry. While general geometry is somewhat /// complex to operate with, it is possible to check if the Geometry returned is RectangularGeometry or, if not - use Geometry.Bounds /// property to get bounding box of the visible portion of the element. /// public static Geometry GetLayoutClip(FrameworkElement element) { CheckArgument(element); return element.GetLayoutClipInternal(); } ////// Returns a UIElement which was being processed by Layout Engine at the moment /// an unhandled exception casued Layout Engine to abandon the operation and unwind. /// Returns non-null result only for a period of time before next layout update is /// initiated. Can be examined from the application exception handler. /// /// The Dispatcher object that specifies the scope of operation. There is one Layout Engine per Dispatcher. public static UIElement GetLayoutExceptionElement(Dispatcher dispatcher) { if(dispatcher == null) throw new ArgumentNullException("dispatcher"); UIElement e = null; ContextLayoutManager lm = ContextLayoutManager.From(dispatcher); if(lm != null) e = lm.GetLastExceptionElement(); return e; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2005 // // File: LayoutInformation // Spec: http://team/sites/Avalon/Specs/LayoutInformation%20class.doc //----------------------------------------------------------------------------- using System; using System.Windows.Media; using System.Windows.Threading; namespace System.Windows.Controls.Primitives { ////// This interface exposes additional layout information not exposed otherwise on FrameworkElement. /// This information is mostly used by the designer programs to produce additional visual clues for the user /// during interactive editing of the elements and layout properties. /// public static class LayoutInformation { private static void CheckArgument(FrameworkElement element) { if (element == null) { throw new ArgumentNullException("element"); } } ////// Returns the rectangle that represents Layout Slot - the layout partition reserved for the /// child by the layout parent. This info is in the coordinte system of the layout parent. /// public static Rect GetLayoutSlot(FrameworkElement element) { CheckArgument(element); return element.PreviousArrangeRect; } ////// Returns a geometry which was computed by layout for the child. This is generally a visible region of the child. /// Layout can compute automatic clip region when the child is larger then layout constraints or has ClipToBounds /// property set. Note that because of LayoutTransform, this could be a non-rectangular geometry. While general geometry is somewhat /// complex to operate with, it is possible to check if the Geometry returned is RectangularGeometry or, if not - use Geometry.Bounds /// property to get bounding box of the visible portion of the element. /// public static Geometry GetLayoutClip(FrameworkElement element) { CheckArgument(element); return element.GetLayoutClipInternal(); } ////// Returns a UIElement which was being processed by Layout Engine at the moment /// an unhandled exception casued Layout Engine to abandon the operation and unwind. /// Returns non-null result only for a period of time before next layout update is /// initiated. Can be examined from the application exception handler. /// /// The Dispatcher object that specifies the scope of operation. There is one Layout Engine per Dispatcher. public static UIElement GetLayoutExceptionElement(Dispatcher dispatcher) { if(dispatcher == null) throw new ArgumentNullException("dispatcher"); UIElement e = null; ContextLayoutManager lm = ContextLayoutManager.From(dispatcher); if(lm != null) e = lm.GetLastExceptionElement(); return e; } } } // 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
- XmlException.cs
- DebugView.cs
- SoapSchemaMember.cs
- BitmapPalettes.cs
- IChannel.cs
- AuthorizationRule.cs
- SrgsOneOf.cs
- FontWeight.cs
- Parameter.cs
- PointCollectionValueSerializer.cs
- ToolBarOverflowPanel.cs
- FilePrompt.cs
- RichTextBoxConstants.cs
- SmtpAuthenticationManager.cs
- AspCompat.cs
- Graphics.cs
- SourceElementsCollection.cs
- Pair.cs
- QilScopedVisitor.cs
- ThicknessKeyFrameCollection.cs
- IChannel.cs
- ErrorView.xaml.cs
- BaseParaClient.cs
- StreamingContext.cs
- RightsManagementEncryptionTransform.cs
- SBCSCodePageEncoding.cs
- unsafenativemethodsother.cs
- FormsAuthenticationEventArgs.cs
- CatalogPart.cs
- XamlPoint3DCollectionSerializer.cs
- KeyGestureValueSerializer.cs
- ListChangedEventArgs.cs
- SubpageParaClient.cs
- Baml2006KnownTypes.cs
- PropertyDescriptor.cs
- PointAnimationClockResource.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- SnapLine.cs
- ThreadNeutralSemaphore.cs
- ListCollectionView.cs
- ManualWorkflowSchedulerService.cs
- XmlSchemaCollection.cs
- XmlComplianceUtil.cs
- PersonalizationState.cs
- BoundColumn.cs
- serverconfig.cs
- MessageFault.cs
- Int32Storage.cs
- VirtualPathProvider.cs
- ReadingWritingEntityEventArgs.cs
- SqlLiftIndependentRowExpressions.cs
- OleDbError.cs
- TableRow.cs
- DbParameterCollectionHelper.cs
- TextMetrics.cs
- InfoCardTraceRecord.cs
- XNodeNavigator.cs
- StringArrayConverter.cs
- LongMinMaxAggregationOperator.cs
- BindingsCollection.cs
- PolyLineSegmentFigureLogic.cs
- WCFModelStrings.Designer.cs
- DataReceivedEventArgs.cs
- EncoderNLS.cs
- ConfigurationLocationCollection.cs
- TextElementEnumerator.cs
- SqlDependencyListener.cs
- RegexTree.cs
- ClientEndpointLoader.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ButtonPopupAdapter.cs
- KeySplineConverter.cs
- EventLogEntry.cs
- Errors.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- HostProtectionPermission.cs
- SchemaMapping.cs
- ReleaseInstanceMode.cs
- CodeDelegateInvokeExpression.cs
- AttributeCollection.cs
- CacheHelper.cs
- TextFindEngine.cs
- IPGlobalProperties.cs
- TypeTypeConverter.cs
- SQLMoney.cs
- WindowsListViewItemCheckBox.cs
- PermissionSetTriple.cs
- SqlStatistics.cs
- TrackingParticipant.cs
- SlipBehavior.cs
- GridViewEditEventArgs.cs
- RewritingSimplifier.cs
- RangeValidator.cs
- LocatorBase.cs
- PeerConnector.cs
- Errors.cs
- ChangeInterceptorAttribute.cs
- TraceContext.cs
- MenuItemBindingCollection.cs
- DataServiceRequest.cs