Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / Primitives / LayoutInformation.cs / 1305600 / 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
- InputLanguageSource.cs
- ProfessionalColorTable.cs
- EncryptedPackage.cs
- LambdaCompiler.Binary.cs
- FacetDescription.cs
- TraceUtility.cs
- ExclusiveNamedPipeTransportManager.cs
- ComAwareEventInfo.cs
- TextElementEditingBehaviorAttribute.cs
- DeploymentExceptionMapper.cs
- HttpApplicationFactory.cs
- AttributeTable.cs
- GridViewAutoFormat.cs
- Content.cs
- HwndSourceParameters.cs
- ResXResourceSet.cs
- ExceptionRoutedEventArgs.cs
- UnsafeNativeMethods.cs
- safelink.cs
- TextSearch.cs
- Pkcs7Recipient.cs
- GuidConverter.cs
- StateManagedCollection.cs
- NegatedCellConstant.cs
- RectangleF.cs
- ObjectConverter.cs
- Scalars.cs
- GraphicsPathIterator.cs
- ThreadStateException.cs
- CombinedGeometry.cs
- Light.cs
- TreeBuilderBamlTranslator.cs
- HtmlElement.cs
- BindingNavigator.cs
- EntityAdapter.cs
- CanonicalizationDriver.cs
- SafeHandle.cs
- ContentDisposition.cs
- AttributeCollection.cs
- TranslateTransform.cs
- HostingPreferredMapPath.cs
- UnsafeNativeMethods.cs
- AssemblyInfo.cs
- EtwTrace.cs
- CompilerParameters.cs
- MD5CryptoServiceProvider.cs
- HtmlGenericControl.cs
- TextParagraph.cs
- precedingsibling.cs
- DateTime.cs
- HttpServerChannel.cs
- CellPartitioner.cs
- IssuanceLicense.cs
- AttributeData.cs
- CacheEntry.cs
- ConfigurationElementProperty.cs
- DataKeyArray.cs
- EqualityComparer.cs
- XmlC14NWriter.cs
- FamilyMapCollection.cs
- ExtendedPropertyDescriptor.cs
- XmlSerializer.cs
- HMACSHA384.cs
- ListViewUpdatedEventArgs.cs
- ActivationWorker.cs
- ToolStripContentPanelRenderEventArgs.cs
- EvidenceBase.cs
- _OverlappedAsyncResult.cs
- XmlArrayItemAttributes.cs
- nulltextcontainer.cs
- ListDictionary.cs
- xsdvalidator.cs
- QueryHandler.cs
- ProtocolsConfigurationHandler.cs
- EventPrivateKey.cs
- SafeHandles.cs
- QilInvokeLateBound.cs
- Transform3D.cs
- DocumentXPathNavigator.cs
- DataGridColumnFloatingHeader.cs
- PresentationAppDomainManager.cs
- ArrayList.cs
- ProgressChangedEventArgs.cs
- ToolStripManager.cs
- Translator.cs
- BindingNavigatorDesigner.cs
- BehaviorEditorPart.cs
- OleDbDataAdapter.cs
- _SslSessionsCache.cs
- TypeExtension.cs
- CodeDomExtensionMethods.cs
- AppliesToBehaviorDecisionTable.cs
- EntityClassGenerator.cs
- XPathNodeInfoAtom.cs
- CompatibleIComparer.cs
- DelegatingConfigHost.cs
- MinimizableAttributeTypeConverter.cs
- ComponentRenameEvent.cs
- KnownBoxes.cs
- SatelliteContractVersionAttribute.cs