Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / MiniLockedBorderGlyph.cs / 1 / MiniLockedBorderGlyph.cs
namespace System.Windows.Forms.Design.Behavior { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms.Design; ////// /// The LockedBorderGlyph draws one side (depending on type) of a SelectionBorder /// in the 'Locked' mode. The constructor will initialize and cache the pen /// and brush objects to avoid uneccessary recreations. /// internal class MiniLockedBorderGlyph : SelectionGlyphBase { private SelectionBorderGlyphType type; ////// /// This constructor extends from the standard SelectionGlyphBase constructor. Note that /// a primarySelection flag is passed in - this will be used when determining the colors /// of the borders. /// internal MiniLockedBorderGlyph(Rectangle controlBounds, SelectionBorderGlyphType type, Behavior behavior, bool primarySelection) : base(behavior) { InitializeGlyph(controlBounds, type, primarySelection); } ////// Helper function that initializes the Glyph based on bounds, type, primary sel, and bordersize. /// private void InitializeGlyph(Rectangle controlBounds, SelectionBorderGlyphType type, bool primarySelection) { hitTestCursor = Cursors.Default;//always default cursor for locked rules = SelectionRules.None;//never change sel rules for locked int borderSize = 1; this.type = type; //this will return the rect representing the bounds of the glyph bounds = DesignerUtils.GetBoundsForSelectionType(controlBounds, type, borderSize); hitBounds = bounds; } ////// /// Simple painting logic for locked Glyphs. /// public override void Paint(PaintEventArgs pe) { //DesignerUtils.DrawSelectionBorder(pe.Graphics, bounds); pe.Graphics.FillRectangle(Brushes.Black, bounds); } } } // 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
- TextProviderWrapper.cs
- ObjectHandle.cs
- AlphaSortedEnumConverter.cs
- ColorTransformHelper.cs
- StructuredTypeEmitter.cs
- XPathNavigator.cs
- CacheMemory.cs
- TextEditorTyping.cs
- EntityDataSourceMemberPath.cs
- EntityDataSourceViewSchema.cs
- CellParaClient.cs
- WebException.cs
- InsufficientMemoryException.cs
- ContractCodeDomInfo.cs
- SmtpFailedRecipientException.cs
- ResourcePart.cs
- LoaderAllocator.cs
- ContentWrapperAttribute.cs
- TabletDeviceInfo.cs
- NotifyParentPropertyAttribute.cs
- EventProviderWriter.cs
- MultiBindingExpression.cs
- DataSysAttribute.cs
- TableLayoutPanelDesigner.cs
- SQLDateTimeStorage.cs
- webbrowsersite.cs
- _BasicClient.cs
- PropertyDescriptor.cs
- ASCIIEncoding.cs
- ClientType.cs
- Utilities.cs
- WebPartMenu.cs
- ProfessionalColors.cs
- ProfileService.cs
- ReadOnlyObservableCollection.cs
- DiscoveryVersionConverter.cs
- ViewEventArgs.cs
- SafeRightsManagementQueryHandle.cs
- CompiledQueryCacheKey.cs
- HttpModuleActionCollection.cs
- XmlDataLoader.cs
- XmlDomTextWriter.cs
- OleDbStruct.cs
- DateRangeEvent.cs
- CompareValidator.cs
- DynamicQueryableWrapper.cs
- sqlnorm.cs
- HandlerBase.cs
- DesignerDataView.cs
- NullableConverter.cs
- SiteMap.cs
- SchemaImporterExtensionsSection.cs
- DependencyPropertyKey.cs
- CompiledQuery.cs
- listviewsubitemcollectioneditor.cs
- AuthenticationException.cs
- SchemaCreator.cs
- HandleExceptionArgs.cs
- AuthenticationService.cs
- ProfileEventArgs.cs
- Screen.cs
- InstanceView.cs
- ButtonFlatAdapter.cs
- XmlUrlEditor.cs
- EventToken.cs
- EntityConnectionStringBuilder.cs
- DataSourceControlBuilder.cs
- StaticSiteMapProvider.cs
- ToolStripItemDesigner.cs
- SimpleTextLine.cs
- SystemEvents.cs
- RegexCapture.cs
- PersonalizationStateInfoCollection.cs
- FixedTextContainer.cs
- InProcStateClientManager.cs
- LogicalMethodInfo.cs
- PointHitTestParameters.cs
- BrowserCapabilitiesFactory.cs
- TraceProvider.cs
- HttpRuntimeSection.cs
- EdmItemCollection.OcAssemblyCache.cs
- Int64Animation.cs
- TraceContextEventArgs.cs
- PasswordDeriveBytes.cs
- TypefaceMap.cs
- CustomPopupPlacement.cs
- Vector3D.cs
- Brush.cs
- FillBehavior.cs
- UnsafeNativeMethods.cs
- DesignerCategoryAttribute.cs
- DynamicRendererThreadManager.cs
- KerberosRequestorSecurityToken.cs
- ColumnWidthChangingEvent.cs
- FilterQuery.cs
- StyleSelector.cs
- UnsafeNativeMethods.cs
- TextRangeEditLists.cs
- RoutedEvent.cs
- UnsafeNativeMethods.cs