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
- ConfigDefinitionUpdates.cs
- SoundPlayerAction.cs
- HijriCalendar.cs
- CryptographicAttribute.cs
- OleDbWrapper.cs
- InfoCardProofToken.cs
- OracleFactory.cs
- Animatable.cs
- SpecialFolderEnumConverter.cs
- LinqDataSourceView.cs
- CollectionViewGroupInternal.cs
- KnownTypes.cs
- BitmapEffect.cs
- XhtmlCssHandler.cs
- DivideByZeroException.cs
- SafeThreadHandle.cs
- WebPartConnectVerb.cs
- MetadataPropertyCollection.cs
- BindingExpressionUncommonField.cs
- TabItemWrapperAutomationPeer.cs
- FixedTextSelectionProcessor.cs
- CompletedAsyncResult.cs
- DelegateHelpers.cs
- XhtmlBasicTextBoxAdapter.cs
- RootBrowserWindow.cs
- TrackingStringDictionary.cs
- SqlCacheDependencyDatabase.cs
- FolderBrowserDialog.cs
- X500Name.cs
- FrameworkEventSource.cs
- CustomAttributeSerializer.cs
- Int32Animation.cs
- ButtonFieldBase.cs
- FieldBuilder.cs
- __Error.cs
- SystemKeyConverter.cs
- DSACryptoServiceProvider.cs
- WindowsGraphics2.cs
- ProjectionCamera.cs
- DataGridViewRowHeaderCell.cs
- HMAC.cs
- ModelItemCollection.cs
- CommonProperties.cs
- basevalidator.cs
- XmlSchemaAnnotation.cs
- SessionPageStatePersister.cs
- ToolStripDropDownButton.cs
- PermissionRequestEvidence.cs
- regiisutil.cs
- XPathArrayIterator.cs
- SelectionWordBreaker.cs
- RegexRunnerFactory.cs
- Span.cs
- FixedSOMImage.cs
- RecognizerStateChangedEventArgs.cs
- TargetInvocationException.cs
- ColorBuilder.cs
- CharConverter.cs
- EdmEntityTypeAttribute.cs
- ToolStrip.cs
- XslAst.cs
- PeekCompletedEventArgs.cs
- ElementNotEnabledException.cs
- ComponentChangedEvent.cs
- DeflateStreamAsyncResult.cs
- ConfigurationSectionCollection.cs
- Attributes.cs
- uribuilder.cs
- ProgressBarRenderer.cs
- XmlConvert.cs
- AssociationType.cs
- WebPartsSection.cs
- XmlILTrace.cs
- WebPartZoneCollection.cs
- XamlDesignerSerializationManager.cs
- IgnoreDeviceFilterElement.cs
- MailHeaderInfo.cs
- HwndSource.cs
- BamlTreeNode.cs
- ChildDocumentBlock.cs
- CopyOfAction.cs
- ArgumentDesigner.xaml.cs
- Membership.cs
- Canvas.cs
- SystemResourceKey.cs
- ArgumentOutOfRangeException.cs
- InputReport.cs
- DataProtection.cs
- SHA256Managed.cs
- ScriptComponentDescriptor.cs
- DataSourceIDConverter.cs
- HtmlAnchor.cs
- DelayLoadType.cs
- SafeRegistryHandle.cs
- Panel.cs
- MergablePropertyAttribute.cs
- MatrixStack.cs
- StylusLogic.cs
- VariableAction.cs
- AssemblyInfo.cs