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
- XmlSerializerNamespaces.cs
- DetailsView.cs
- TreeNodeCollection.cs
- MenuCommand.cs
- ModelPerspective.cs
- XmlDataContract.cs
- DecimalConstantAttribute.cs
- Animatable.cs
- Deserializer.cs
- CompilerInfo.cs
- LogWriteRestartAreaState.cs
- HashAlgorithm.cs
- EventManager.cs
- ColorAnimation.cs
- WorkflowPersistenceContext.cs
- TdsRecordBufferSetter.cs
- Point3D.cs
- ComboBoxRenderer.cs
- TextProviderWrapper.cs
- CssClassPropertyAttribute.cs
- _SingleItemRequestCache.cs
- RenderData.cs
- JsonStringDataContract.cs
- AnnotationHelper.cs
- MenuItemAutomationPeer.cs
- TraceListeners.cs
- TextPenaltyModule.cs
- OuterProxyWrapper.cs
- NonBatchDirectoryCompiler.cs
- CounterCreationData.cs
- HtmlTitle.cs
- MdiWindowListStrip.cs
- LongMinMaxAggregationOperator.cs
- BaseParser.cs
- DataBoundControlHelper.cs
- ConversionValidationRule.cs
- StringHandle.cs
- LineServices.cs
- LiteralControl.cs
- _Semaphore.cs
- HtmlContainerControl.cs
- TextureBrush.cs
- FirstMatchCodeGroup.cs
- XamlTreeBuilderBamlRecordWriter.cs
- Brush.cs
- Selector.cs
- VectorConverter.cs
- DBCommand.cs
- BufferModeSettings.cs
- RankException.cs
- PropertyInfoSet.cs
- AddValidationError.cs
- FaultCallbackWrapper.cs
- ContractNamespaceAttribute.cs
- GridViewRowEventArgs.cs
- CodeTypeMember.cs
- DataControlLinkButton.cs
- AppLevelCompilationSectionCache.cs
- ClearCollection.cs
- coordinator.cs
- BitmapFrameDecode.cs
- LogExtent.cs
- PropertySet.cs
- UserControl.cs
- HTTPNotFoundHandler.cs
- TriState.cs
- Operator.cs
- Visual.cs
- RenderingBiasValidation.cs
- MessageLogger.cs
- ToggleButtonAutomationPeer.cs
- SectionInformation.cs
- NTAccount.cs
- RuleValidation.cs
- Permission.cs
- StylusPointCollection.cs
- DockPatternIdentifiers.cs
- PropertyChangedEventArgs.cs
- PartitionerStatic.cs
- EdmConstants.cs
- Compiler.cs
- LongTypeConverter.cs
- SystemBrushes.cs
- TextCompositionManager.cs
- InvokePattern.cs
- DataGridViewDataErrorEventArgs.cs
- Hex.cs
- InstanceLockedException.cs
- MenuItemBinding.cs
- MetadataUtilsSmi.cs
- EventWaitHandle.cs
- dbenumerator.cs
- XmlSequenceWriter.cs
- RectConverter.cs
- RelationshipSet.cs
- SafeNativeMethods.cs
- DeclarativeCatalogPart.cs
- LateBoundBitmapDecoder.cs
- Qualifier.cs
- counter.cs