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
- HelpProvider.cs
- QilBinary.cs
- GradientStopCollection.cs
- LocalizationParserHooks.cs
- Transform3DCollection.cs
- ObfuscateAssemblyAttribute.cs
- PipelineModuleStepContainer.cs
- ActivityDesignerHelper.cs
- StaticSiteMapProvider.cs
- KnownColorTable.cs
- BufferedConnection.cs
- RightsManagementEncryptedStream.cs
- PerformanceCountersBase.cs
- DbParameterCollectionHelper.cs
- documentsequencetextview.cs
- StructuredTypeInfo.cs
- StringAnimationUsingKeyFrames.cs
- ErasingStroke.cs
- WebPartRestoreVerb.cs
- ExpressionNode.cs
- CredentialManagerDialog.cs
- HtmlAnchor.cs
- IPAddress.cs
- AncillaryOps.cs
- TableLayoutPanelDesigner.cs
- LinqToSqlWrapper.cs
- KeyNotFoundException.cs
- XmlSchemaComplexType.cs
- Wow64ConfigurationLoader.cs
- WebProxyScriptElement.cs
- HttpModuleCollection.cs
- HttpWrapper.cs
- ToolStripSystemRenderer.cs
- ProcessHostServerConfig.cs
- EventPropertyMap.cs
- XmlSchemaObjectCollection.cs
- DataTableClearEvent.cs
- AddInAdapter.cs
- KeySpline.cs
- ToolStripTemplateNode.cs
- FrameSecurityDescriptor.cs
- SqlDuplicator.cs
- DataKey.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- StylusEventArgs.cs
- SystemMulticastIPAddressInformation.cs
- ActivationArguments.cs
- MetadataLocation.cs
- CqlWriter.cs
- OracleInfoMessageEventArgs.cs
- Int32Collection.cs
- ToolStripItemTextRenderEventArgs.cs
- CorePropertiesFilter.cs
- SessionParameter.cs
- FormViewUpdateEventArgs.cs
- ParagraphResult.cs
- Context.cs
- NamespaceImport.cs
- TextEffectCollection.cs
- WorkflowViewService.cs
- AutomationProperty.cs
- XmlAttributeOverrides.cs
- TextContainerHelper.cs
- UpdateExpressionVisitor.cs
- OledbConnectionStringbuilder.cs
- PerformanceCounterManager.cs
- EndpointDiscoveryMetadata.cs
- PropertyChangingEventArgs.cs
- FlowDocumentView.cs
- ConsoleKeyInfo.cs
- Typography.cs
- TextElementCollection.cs
- DataGridSortCommandEventArgs.cs
- WorkflowCommandExtensionItem.cs
- DispatchRuntime.cs
- ModelItemDictionary.cs
- SiteMapPath.cs
- DataGridPagingPage.cs
- FontFamilyIdentifier.cs
- ConfigurationFileMap.cs
- ColorConvertedBitmap.cs
- MarginCollapsingState.cs
- infer.cs
- CopyCodeAction.cs
- DurableOperationAttribute.cs
- ParagraphVisual.cs
- ProfilePropertySettingsCollection.cs
- ResourceIDHelper.cs
- GPRECTF.cs
- ZipPackagePart.cs
- ApplicationProxyInternal.cs
- TrustLevel.cs
- SmiSettersStream.cs
- CfgParser.cs
- BufferedReadStream.cs
- MimeTypeMapper.cs
- QueryInterceptorAttribute.cs
- DispatchWrapper.cs
- QueueAccessMode.cs
- DurableMessageDispatchInspector.cs