Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- FileDialog_Vista.cs
- OptimisticConcurrencyException.cs
- CrossAppDomainChannel.cs
- ParagraphResult.cs
- FontSource.cs
- While.cs
- SchemaExporter.cs
- StrongName.cs
- XmlLanguageConverter.cs
- TableLayoutPanelResizeGlyph.cs
- WebPartDeleteVerb.cs
- IdentityHolder.cs
- TypeSchema.cs
- RegexInterpreter.cs
- Filter.cs
- MsmqIntegrationBinding.cs
- Decimal.cs
- BitConverter.cs
- RequestBringIntoViewEventArgs.cs
- ToolboxItemAttribute.cs
- ViewStateException.cs
- StringSorter.cs
- FontResourceCache.cs
- ResXFileRef.cs
- MulticastDelegate.cs
- StylusPointDescription.cs
- ProviderCommandInfoUtils.cs
- RoleServiceManager.cs
- DesignTimeData.cs
- OleDbConnection.cs
- ReceiveCompletedEventArgs.cs
- SqlProviderServices.cs
- GridEntry.cs
- FlowLayoutSettings.cs
- ObjectTag.cs
- XmlExpressionDumper.cs
- Pkcs7Signer.cs
- EntityParameter.cs
- ControlBindingsCollection.cs
- ILGenerator.cs
- TraceSection.cs
- DataGridToolTip.cs
- DistinctQueryOperator.cs
- HtmlElementErrorEventArgs.cs
- Int64Storage.cs
- FrameworkTextComposition.cs
- ExpressionLink.cs
- XmlSchemaSubstitutionGroup.cs
- FormsAuthenticationUserCollection.cs
- TrailingSpaceComparer.cs
- SoapMessage.cs
- SizeConverter.cs
- ClientUtils.cs
- CLRBindingWorker.cs
- TextHintingModeValidation.cs
- DataGridViewCellStateChangedEventArgs.cs
- TemplateControlCodeDomTreeGenerator.cs
- SourceInterpreter.cs
- BitStack.cs
- CounterNameConverter.cs
- MenuTracker.cs
- SmiEventStream.cs
- PointF.cs
- DataBindingList.cs
- BindingContext.cs
- SelectedGridItemChangedEvent.cs
- XmlSchemaElement.cs
- XPathConvert.cs
- GridToolTip.cs
- UpdatePanelControlTrigger.cs
- PartitionerQueryOperator.cs
- IOException.cs
- ReadWriteObjectLock.cs
- DataBoundControlHelper.cs
- SqlEnums.cs
- OverlappedAsyncResult.cs
- ScriptManager.cs
- XamlBrushSerializer.cs
- DeferredReference.cs
- SoapElementAttribute.cs
- SerialPort.cs
- UriParserTemplates.cs
- ResourceSetExpression.cs
- EntityProxyTypeInfo.cs
- RequestQueryProcessor.cs
- CategoryAttribute.cs
- CompiledAction.cs
- Operand.cs
- TreeViewHitTestInfo.cs
- DetailsViewDeletedEventArgs.cs
- Exceptions.cs
- DocumentXPathNavigator.cs
- DbConnectionPool.cs
- ComponentCommands.cs
- ProtocolsConfigurationHandler.cs
- DesignerDataColumn.cs
- AutomationPeer.cs
- TextTreeRootNode.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- MatrixTransform3D.cs