Code:
/ DotNET / DotNET / 8.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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SpecularMaterial.cs
- Bits.cs
- DemultiplexingClientMessageFormatter.cs
- SecurityMode.cs
- columnmapkeybuilder.cs
- ListViewInsertionMark.cs
- StorageMappingItemCollection.cs
- XPathNodeList.cs
- StyleTypedPropertyAttribute.cs
- EntitySqlException.cs
- DataControlFieldHeaderCell.cs
- BindValidator.cs
- SecurityHelper.cs
- LinearQuaternionKeyFrame.cs
- Size3D.cs
- XmlDataImplementation.cs
- UnsafeNativeMethodsMilCoreApi.cs
- SamlConditions.cs
- ExtentCqlBlock.cs
- ProcessInputEventArgs.cs
- LogicalExpressionEditor.cs
- DataServiceRequest.cs
- EventProvider.cs
- X509Utils.cs
- ProcessModelInfo.cs
- DesignerHelpers.cs
- WebPartConnectionsCancelEventArgs.cs
- StoreContentChangedEventArgs.cs
- IsolatedStorage.cs
- SyntaxCheck.cs
- DBCommand.cs
- XPathSelfQuery.cs
- Win32SafeHandles.cs
- Mutex.cs
- WrappedIUnknown.cs
- BulletChrome.cs
- DataDocumentXPathNavigator.cs
- NamespaceList.cs
- TemplateBamlRecordReader.cs
- DatatypeImplementation.cs
- TaskSchedulerException.cs
- XmlAttributeOverrides.cs
- WebProxyScriptElement.cs
- ParameterElement.cs
- EventMappingSettings.cs
- AnnotationAdorner.cs
- XmlNode.cs
- Point3DValueSerializer.cs
- LocalFileSettingsProvider.cs
- DBConnection.cs
- MessagingDescriptionAttribute.cs
- TreeWalkHelper.cs
- DataSysAttribute.cs
- ColorConvertedBitmap.cs
- FileLoadException.cs
- ParallelEnumerableWrapper.cs
- PackageRelationshipCollection.cs
- UpdateCommand.cs
- DesignerDataSourceView.cs
- MappingItemCollection.cs
- _Rfc2616CacheValidators.cs
- TransactionScope.cs
- RequestCache.cs
- DataGridViewCellMouseEventArgs.cs
- RoleService.cs
- listitem.cs
- RealizationContext.cs
- LinearGradientBrush.cs
- ECDiffieHellmanCng.cs
- EditorPartCollection.cs
- lengthconverter.cs
- Model3DGroup.cs
- EntitySqlQueryBuilder.cs
- UIElementParaClient.cs
- DynamicRendererThreadManager.cs
- PrintDialogDesigner.cs
- ValueOfAction.cs
- CompilerHelpers.cs
- FontInfo.cs
- CodeTypeParameterCollection.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- MenuTracker.cs
- TextRangeEditTables.cs
- Models.cs
- invalidudtexception.cs
- EntityCollection.cs
- ActivitySurrogate.cs
- Transform.cs
- Span.cs
- DataGrid.cs
- Parsers.cs
- Divide.cs
- XmlUrlResolver.cs
- AutoFocusStyle.xaml.cs
- CodeFieldReferenceExpression.cs
- CompilationPass2Task.cs
- ExclusiveCanonicalizationTransform.cs
- RectIndependentAnimationStorage.cs
- WebPartAddingEventArgs.cs
- ControlPropertyNameConverter.cs