Code:
/ FX-1434 / FX-1434 / 1.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
- EdmValidator.cs
- TemplateContainer.cs
- InternalTransaction.cs
- Dump.cs
- BaseDataListDesigner.cs
- CharConverter.cs
- StringAnimationUsingKeyFrames.cs
- ArgumentOutOfRangeException.cs
- EDesignUtil.cs
- CultureTableRecord.cs
- CopyOfAction.cs
- AtomServiceDocumentSerializer.cs
- SelectedDatesCollection.cs
- PrintingPermission.cs
- FrameworkContentElement.cs
- BitmapEffectDrawing.cs
- RegistryKey.cs
- WindowsToolbarItemAsMenuItem.cs
- MutexSecurity.cs
- ProcessHostConfigUtils.cs
- Int32.cs
- BindingNavigator.cs
- MailWriter.cs
- PerformanceCounterManager.cs
- UnmanagedMemoryStream.cs
- UInt64Converter.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- ServicePoint.cs
- SystemEvents.cs
- AdCreatedEventArgs.cs
- ObjectListFieldCollection.cs
- TextSimpleMarkerProperties.cs
- XmlCountingReader.cs
- CallbackHandler.cs
- ItemsPanelTemplate.cs
- Transform3D.cs
- SHA256Managed.cs
- HierarchicalDataBoundControl.cs
- FormConverter.cs
- ConfigurationStrings.cs
- GeneralTransform.cs
- XmlDomTextWriter.cs
- CollectionCodeDomSerializer.cs
- PermissionSet.cs
- AccessedThroughPropertyAttribute.cs
- EventMappingSettings.cs
- HttpProcessUtility.cs
- SafeNativeMethods.cs
- DataServiceStreamResponse.cs
- PropertyValueUIItem.cs
- ClosableStream.cs
- UrlMapping.cs
- ClockGroup.cs
- XmlCustomFormatter.cs
- UTF7Encoding.cs
- ActivityInstance.cs
- AttributeCollection.cs
- LinearGradientBrush.cs
- Transform3DGroup.cs
- SqlInfoMessageEvent.cs
- ObjectListFieldCollection.cs
- HttpCapabilitiesEvaluator.cs
- Variable.cs
- EventPropertyMap.cs
- DetailsViewModeEventArgs.cs
- SimpleRecyclingCache.cs
- AnonymousIdentificationModule.cs
- HttpCapabilitiesEvaluator.cs
- SafeNativeMethods.cs
- DateTimeValueSerializer.cs
- PrimitiveCodeDomSerializer.cs
- Border.cs
- CharAnimationBase.cs
- OpenTypeCommon.cs
- GeometryModel3D.cs
- SwitchLevelAttribute.cs
- BasicHttpSecurityElement.cs
- WriterOutput.cs
- DomainLiteralReader.cs
- WmlObjectListAdapter.cs
- WinFormsUtils.cs
- InputMethodStateChangeEventArgs.cs
- SerializationInfoEnumerator.cs
- ThreadAbortException.cs
- SecuritySessionSecurityTokenProvider.cs
- CodeDomLocalizationProvider.cs
- AutomationElementIdentifiers.cs
- ComplexBindingPropertiesAttribute.cs
- PropertyDescriptorCollection.cs
- Util.cs
- HotSpot.cs
- FormsAuthenticationCredentials.cs
- Exceptions.cs
- ProvidePropertyAttribute.cs
- WebHttpBindingCollectionElement.cs
- CounterNameConverter.cs
- Transaction.cs
- SerTrace.cs
- LockCookie.cs
- DelegateSerializationHolder.cs