Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / FlowPanelDesigner.cs / 1 / FlowPanelDesigner.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.Design { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Windows.Forms.Design.Behavior; ////// /// Base class to our flow control designers: TableLayoutPanel and FlowLayoutPanel. /// This class shares common operations for these designers including: /// Stripping all padding SnapLines, adding children, and refreshing selection /// after a drag-drop operation - since these types of controls will always /// reposition children. /// internal class FlowPanelDesigner : PanelDesigner { ////// /// Overridden to disallow SnapLines during drag operations if the primary drag control /// is over the FlowPanelDesigner. /// public override bool ParticipatesWithSnapLines { get { return false; } } ////// /// Get the standard SnapLines from our ParentControlDesigner then /// strips all the padding lines - since we don't want these guys /// for flow designers. public override IList SnapLines { get { ArrayList snapLines = (ArrayList)base.SnapLines; //identify all the paddings to remove ArrayList paddingsToRemove = new ArrayList(4); foreach (SnapLine line in snapLines) { if (line.Filter != null && line.Filter.Contains(SnapLine.Padding)) { paddingsToRemove.Add(line); } } //remove all padding foreach (SnapLine line in paddingsToRemove) { snapLines.Remove(line); } return snapLines; } } /// /// /// Overrides the base and skips the adjustment of the child position /// since the runtime control will re-position this for us. /// internal override void AddChildControl(Control newChild) { // Skip location adjustment because FlowPanel is going to position this control. // Also, Skip z-order adjustment because SendToFront will put the new control at the // beginning of the flow instead of the end, plus FlowLayout is already preventing // overlap. this.Control.Controls.Add(newChild); } ////// /// We override this, call base, then attempt to re-sync the selection /// since the control will most likely re-position a child for us. /// protected override void OnDragDrop(DragEventArgs de) { base.OnDragDrop(de); SelectionManager sm = GetService(typeof(SelectionManager)) as SelectionManager; if (sm != null) { sm.Refresh(); } } } } // 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
- ParenthesizePropertyNameAttribute.cs
- ServiceOperationParameter.cs
- IdentityNotMappedException.cs
- MetadataException.cs
- VSWCFServiceContractGenerator.cs
- Int32RectConverter.cs
- IconBitmapDecoder.cs
- BorderGapMaskConverter.cs
- Literal.cs
- SendMailErrorEventArgs.cs
- StatusBarAutomationPeer.cs
- XPathSelectionIterator.cs
- RTTrackingProfile.cs
- Aes.cs
- XmlSchemaSimpleTypeRestriction.cs
- HttpCookieCollection.cs
- KnowledgeBase.cs
- HealthMonitoringSectionHelper.cs
- ExtensibleClassFactory.cs
- ClientTargetSection.cs
- AnimationException.cs
- ThicknessAnimation.cs
- CodeTypeReference.cs
- ImageMapEventArgs.cs
- LocalFileSettingsProvider.cs
- SortFieldComparer.cs
- AffineTransform3D.cs
- _NegoStream.cs
- SchemaTypeEmitter.cs
- SvcMapFile.cs
- ObjectSet.cs
- Application.cs
- SQLRoleProvider.cs
- COM2PropertyPageUITypeConverter.cs
- ObjectReferenceStack.cs
- XmlReflectionMember.cs
- PropertyInfoSet.cs
- InvalidCastException.cs
- Encoder.cs
- TreeNodeBindingDepthConverter.cs
- SharedStatics.cs
- TransformerConfigurationWizardBase.cs
- RulePatternOps.cs
- ManagedIStream.cs
- PartialCachingAttribute.cs
- AuthorizationPolicyTypeElementCollection.cs
- SqlParameterCollection.cs
- DetailsViewDeletedEventArgs.cs
- UnsupportedPolicyOptionsException.cs
- MetadataCollection.cs
- CompressedStack.cs
- HtmlInputReset.cs
- BaseDataListComponentEditor.cs
- TextChange.cs
- SafeEventLogWriteHandle.cs
- XamlUtilities.cs
- _SslState.cs
- DispatchProxy.cs
- QueryResults.cs
- Range.cs
- BaseDataListPage.cs
- ToolboxComponentsCreatedEventArgs.cs
- TiffBitmapDecoder.cs
- FormsAuthenticationCredentials.cs
- ObservableCollection.cs
- TextEmbeddedObject.cs
- TemplateControlBuildProvider.cs
- Repeater.cs
- EndpointBehaviorElementCollection.cs
- TextRunProperties.cs
- SqlExpressionNullability.cs
- GeometryDrawing.cs
- SpeechSynthesizer.cs
- AppearanceEditorPart.cs
- MaxValueConverter.cs
- NullReferenceException.cs
- JsonXmlDataContract.cs
- GenericArgumentsUpdater.cs
- EventLogPermissionEntryCollection.cs
- BaseTreeIterator.cs
- TextMarkerSource.cs
- DrawingGroupDrawingContext.cs
- DescendentsWalker.cs
- SamlAuthenticationStatement.cs
- FormViewPageEventArgs.cs
- BrowserCapabilitiesFactory.cs
- ColumnBinding.cs
- MetaType.cs
- TrackingConditionCollection.cs
- WebSysDescriptionAttribute.cs
- WebHttpEndpoint.cs
- SHA256.cs
- HostProtectionException.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DataGridClipboardHelper.cs
- HierarchicalDataBoundControlAdapter.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- SiteOfOriginPart.cs
- DataGridState.cs
- Literal.cs