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
- RestClientProxyHandler.cs
- XmlCollation.cs
- ConfigurationException.cs
- XmlBindingWorker.cs
- DataListItem.cs
- SmiContextFactory.cs
- xmlsaver.cs
- FormViewUpdateEventArgs.cs
- ToolStripManager.cs
- GridViewCancelEditEventArgs.cs
- DispatcherFrame.cs
- StreamSecurityUpgradeAcceptor.cs
- BaseDataBoundControlDesigner.cs
- DateTime.cs
- TextServicesManager.cs
- TreeChangeInfo.cs
- DefaultBinder.cs
- PropertyDescriptors.cs
- AncillaryOps.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- FilterQuery.cs
- TypedColumnHandler.cs
- DataGridViewCheckBoxCell.cs
- ZipIOBlockManager.cs
- LabelEditEvent.cs
- PlatformCulture.cs
- CompiledRegexRunnerFactory.cs
- SqlVersion.cs
- ConfigDefinitionUpdates.cs
- ActivatableWorkflowsQueryResult.cs
- Converter.cs
- ConfigurationErrorsException.cs
- CriticalHandle.cs
- ObjectStateEntry.cs
- LayoutDump.cs
- GridViewSelectEventArgs.cs
- TimeSpanStorage.cs
- Int64.cs
- RenderDataDrawingContext.cs
- COM2Properties.cs
- StringHandle.cs
- CommandField.cs
- MenuItemCollectionEditorDialog.cs
- SystemIPAddressInformation.cs
- PtsContext.cs
- TextRangeAdaptor.cs
- StructuralObject.cs
- DataTableExtensions.cs
- login.cs
- SharedTcpTransportManager.cs
- ListenerAdapterBase.cs
- WpfGeneratedKnownTypes.cs
- XmlSecureResolver.cs
- VirtualDirectoryMappingCollection.cs
- EventSourceCreationData.cs
- Configuration.cs
- HttpsChannelListener.cs
- TemplateParser.cs
- CorrelationQueryBehavior.cs
- TransformationRules.cs
- PointAnimation.cs
- DataControlLinkButton.cs
- WebGetAttribute.cs
- SHA384Managed.cs
- ScrollEventArgs.cs
- CodeDirectionExpression.cs
- FillErrorEventArgs.cs
- CodeDomSerializerException.cs
- DiscoveryClientChannelBase.cs
- PageAdapter.cs
- MdiWindowListItemConverter.cs
- GridViewRow.cs
- RecognizerBase.cs
- XMLSchema.cs
- DynamicMethod.cs
- Pair.cs
- Unit.cs
- Component.cs
- XmlElement.cs
- TextContainerHelper.cs
- ConstraintManager.cs
- TextBoxView.cs
- SoapHeaderAttribute.cs
- MethodBuilderInstantiation.cs
- DrawingGroup.cs
- NumericUpDownAcceleration.cs
- XXXOnTypeBuilderInstantiation.cs
- StateMachineWorkflow.cs
- SqlDataSourceCommandEventArgs.cs
- XmlNodeChangedEventArgs.cs
- ProxyWebPartManager.cs
- List.cs
- LineGeometry.cs
- WindowCollection.cs
- AjaxFrameworkAssemblyAttribute.cs
- ValueUtilsSmi.cs
- XmlUnspecifiedAttribute.cs
- ServiceMetadataContractBehavior.cs
- MouseGesture.cs
- DataSourceDesigner.cs