Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / Layout / LayoutEngine.cs / 1 / LayoutEngine.cs
//#define LAYOUT_PERFWATCH //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Layout { using System; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Drawing; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Security.Permissions; ///public abstract class LayoutEngine { internal IArrangedElement CastToArrangedElement(object obj) { IArrangedElement element = obj as IArrangedElement; if(obj == null) { throw new NotSupportedException(SR.GetString(SR.LayoutEngineUnsupportedType, obj.GetType())); } return element; } internal virtual Size GetPreferredSize(IArrangedElement container, Size proposedConstraints) { return Size.Empty; } /// public virtual void InitLayout(object child, BoundsSpecified specified) { InitLayoutCore(CastToArrangedElement(child), specified); } internal virtual void InitLayoutCore(IArrangedElement element, BoundsSpecified bounds) {} internal virtual void ProcessSuspendedLayoutEventArgs(IArrangedElement container, LayoutEventArgs args) {} #if LAYOUT_PERFWATCH private static int LayoutWatch = 100; #endif /// [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")] public virtual bool Layout(object container, LayoutEventArgs layoutEventArgs) { #if LAYOUT_PERFWATCH Debug.WriteLine(container.GetType().Name + "::Layout(" + (layoutEventArgs.AffectedControl != null ? layoutEventArgs.AffectedControl.Name : "null") + ", " + layoutEventArgs.AffectedProperty + ")"); Debug.Indent(); Stopwatch sw = new Stopwatch(); sw.Start(); #endif bool parentNeedsLayout = LayoutCore(CastToArrangedElement(container), layoutEventArgs); #if LAYOUT_PERFWATCH sw.Stop(); if (sw.ElapsedMilliseconds > LayoutWatch && Debugger.IsAttached) { Debugger.Break(); } Debug.Unindent(); Debug.WriteLine(container.GetType().Name + "::Layout elapsed " + sw.ElapsedMilliseconds.ToString() + " returned: " + parentNeedsLayout); #endif return parentNeedsLayout; } internal virtual bool LayoutCore(IArrangedElement container, LayoutEventArgs layoutEventArgs) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XPathNodePointer.cs
- HierarchicalDataSourceControl.cs
- DesignerWebPartChrome.cs
- WorkflowInvoker.cs
- ImpersonationContext.cs
- FlowDecision.cs
- StringInfo.cs
- FilterQueryOptionExpression.cs
- EncodingStreamWrapper.cs
- Util.cs
- Section.cs
- X509Certificate.cs
- OleDragDropHandler.cs
- RawStylusSystemGestureInputReport.cs
- IpcClientChannel.cs
- TimeEnumHelper.cs
- XPathParser.cs
- Shape.cs
- ProxyHelper.cs
- Vector3DAnimationBase.cs
- TextBlockAutomationPeer.cs
- UnsafeNativeMethodsPenimc.cs
- MILUtilities.cs
- FloaterParagraph.cs
- PrivateFontCollection.cs
- PkcsMisc.cs
- ValueUtilsSmi.cs
- WSHttpBindingBase.cs
- XmlRootAttribute.cs
- Constraint.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- BatchWriter.cs
- CodeSubDirectoriesCollection.cs
- TemplatedControlDesigner.cs
- BufferedConnection.cs
- TableLayoutPanelCellPosition.cs
- GestureRecognitionResult.cs
- PersonalizationProviderCollection.cs
- ObjectStateEntryDbDataRecord.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- StringSorter.cs
- GraphicsState.cs
- ObjectIDGenerator.cs
- BypassElementCollection.cs
- ChannelOptions.cs
- OleDbError.cs
- util.cs
- DataGridComponentEditor.cs
- TraceSection.cs
- GridEntryCollection.cs
- GlyphManager.cs
- CompModSwitches.cs
- ListBoxAutomationPeer.cs
- _emptywebproxy.cs
- Fonts.cs
- CalendarItem.cs
- WebEventTraceProvider.cs
- NativeObjectSecurity.cs
- OracleCommand.cs
- HashAlgorithm.cs
- MemberRelationshipService.cs
- StringKeyFrameCollection.cs
- ObjectViewEntityCollectionData.cs
- DependencyPropertyConverter.cs
- login.cs
- BreadCrumbTextConverter.cs
- DelimitedListTraceListener.cs
- ListItem.cs
- ClientProxyGenerator.cs
- UnknownWrapper.cs
- SessionParameter.cs
- TimelineGroup.cs
- MediaElement.cs
- TextSearch.cs
- ISAPIWorkerRequest.cs
- WindowsRegion.cs
- OracleBFile.cs
- Executor.cs
- UIElement3DAutomationPeer.cs
- Registry.cs
- ExpanderAutomationPeer.cs
- StylusPointProperty.cs
- DBSchemaTable.cs
- Camera.cs
- AttributeTableBuilder.cs
- OleDbRowUpdatingEvent.cs
- GlobalizationSection.cs
- DeferredElementTreeState.cs
- TypeSemantics.cs
- ReadOnlyDataSourceView.cs
- ReflectionPermission.cs
- TimeIntervalCollection.cs
- TemplateKey.cs
- SchemaImporterExtensionElementCollection.cs
- DataColumnMapping.cs
- IconConverter.cs
- GridItem.cs
- PeerChannelFactory.cs
- WebPartConnection.cs
- XmlComplianceUtil.cs