Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / DesignerToolStripControlHost.cs / 1 / DesignerToolStripControlHost.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms.Design { using System.Design; using Accessibility; using System.ComponentModel; using System.Diagnostics; using System; using System.Security; using System.Security.Permissions; using System.ComponentModel.Design; using System.Windows.Forms; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms.Design.Behavior; ////// /// This internal class is used by the new ToolStripDesigner to add a dummy /// node to the end. This class inherits from WinBarControlHost and overrides the /// CanSelect property so that the dummy Node when shown in the designer doesnt show /// selection on Mouse movements. /// The image is set to theDummyNodeImage embedded into the resources. /// ///internal class DesignerToolStripControlHost : ToolStripControlHost, IComponent { private BehaviorService b; internal ToolStrip parent=null; // // Constructor // /// public DesignerToolStripControlHost(Control c) : base(c) { // this ToolStripItem should not have defaultPadding. this.Margin = Padding.Empty; } /// /// /// We need to return Default size for Editor ToolStrip (92, 22). /// protected override Size DefaultSize { get { return new Size(92, 22); } } internal GlyphCollection GetGlyphs(ToolStrip parent, GlyphCollection glyphs, System.Windows.Forms.Design.Behavior.Behavior standardBehavior) { if (b == null) { b = (BehaviorService)parent.Site.GetService(typeof(BehaviorService)); } Point loc = b.ControlToAdornerWindow(this.Parent); Rectangle r = this.Bounds; r.Offset(loc); r.Inflate (-2 , -2); glyphs.Add(new MiniLockedBorderGlyph(r, SelectionBorderGlyphType.Top, standardBehavior, true)); glyphs.Add(new MiniLockedBorderGlyph(r, SelectionBorderGlyphType.Bottom, standardBehavior, true)); glyphs.Add(new MiniLockedBorderGlyph(r, SelectionBorderGlyphType.Left, standardBehavior, true)); glyphs.Add(new MiniLockedBorderGlyph(r, SelectionBorderGlyphType.Right, standardBehavior, true)); return glyphs; } internal void RefreshSelectionGlyph() { ToolStrip miniToolStrip = this.Control as ToolStrip; if (miniToolStrip != null) { ToolStripTemplateNode.MiniToolStripRenderer renderer = miniToolStrip.Renderer as ToolStripTemplateNode.MiniToolStripRenderer; if (renderer != null) { renderer.State = (int)TemplateNodeSelectionState.None; miniToolStrip.Invalidate(); } } } internal void SelectControl() { ToolStrip miniToolStrip = this.Control as ToolStrip; if (miniToolStrip != null) { ToolStripTemplateNode.MiniToolStripRenderer renderer = miniToolStrip.Renderer as ToolStripTemplateNode.MiniToolStripRenderer; if (renderer != null) { renderer.State = (int)TemplateNodeSelectionState.TemplateNodeSelected; miniToolStrip.Invalidate(); } } } } } // 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
- MarkupExtensionParser.cs
- JavaScriptObjectDeserializer.cs
- HttpProxyCredentialType.cs
- securitycriticaldata.cs
- XmlSignatureProperties.cs
- D3DImage.cs
- TextRangeEditLists.cs
- SimpleWorkerRequest.cs
- DiscoveryDocumentLinksPattern.cs
- MatchingStyle.cs
- Transform.cs
- CapabilitiesAssignment.cs
- AxisAngleRotation3D.cs
- Buffer.cs
- Lazy.cs
- EditorZoneAutoFormat.cs
- LayoutExceptionEventArgs.cs
- InstanceHandleReference.cs
- HttpWrapper.cs
- StrokeNodeEnumerator.cs
- BigInt.cs
- CommandDevice.cs
- RemotingHelper.cs
- FormsAuthenticationUser.cs
- StylusEditingBehavior.cs
- MoveSizeWinEventHandler.cs
- LocalizedNameDescriptionPair.cs
- DocumentGrid.cs
- NCryptSafeHandles.cs
- OrderByQueryOptionExpression.cs
- ObjectDataSourceSelectingEventArgs.cs
- KeyValueConfigurationElement.cs
- DefaultObjectMappingItemCollection.cs
- SimpleBitVector32.cs
- PathData.cs
- ImageDrawing.cs
- MissingFieldException.cs
- precedingquery.cs
- ReflectEventDescriptor.cs
- BrushConverter.cs
- StringKeyFrameCollection.cs
- DataTablePropertyDescriptor.cs
- Model3D.cs
- Exceptions.cs
- UnitySerializationHolder.cs
- SystemWebSectionGroup.cs
- Int16Storage.cs
- FilteredAttributeCollection.cs
- TransactionsSectionGroup.cs
- ParsedAttributeCollection.cs
- BuildManager.cs
- Double.cs
- ManagedFilter.cs
- ProbeMatchesMessageCD1.cs
- RegexCaptureCollection.cs
- PersonalizationStateInfoCollection.cs
- EnumConverter.cs
- InstanceStore.cs
- XmlnsCache.cs
- ServiceModelDictionary.cs
- ReadWriteSpinLock.cs
- HttpCacheParams.cs
- ResourceReferenceKeyNotFoundException.cs
- Light.cs
- DynamicRendererThreadManager.cs
- _IPv4Address.cs
- PolygonHotSpot.cs
- WebEvents.cs
- CompilerTypeWithParams.cs
- safex509handles.cs
- XmlWellformedWriter.cs
- UriWriter.cs
- webproxy.cs
- FieldTemplateFactory.cs
- PaintEvent.cs
- TreeNodeBinding.cs
- MachinePropertyVariants.cs
- QuinticEase.cs
- NamespaceInfo.cs
- XamlReaderConstants.cs
- TaskForm.cs
- ChtmlTextWriter.cs
- PassportAuthenticationEventArgs.cs
- PrivilegeNotHeldException.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- HMAC.cs
- CodeLabeledStatement.cs
- SafeSerializationManager.cs
- WebBaseEventKeyComparer.cs
- XPathAncestorIterator.cs
- sortedlist.cs
- ToggleProviderWrapper.cs
- InplaceBitmapMetadataWriter.cs
- SafeEventLogWriteHandle.cs
- DataSourceSelectArguments.cs
- DropSource.cs
- NameObjectCollectionBase.cs
- AssemblySettingAttributes.cs
- TargetInvocationException.cs
- StandardOleMarshalObject.cs