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
- DataControlButton.cs
- QueryResponse.cs
- DataBindingHandlerAttribute.cs
- StylusPointPropertyInfoDefaults.cs
- SqlMetaData.cs
- CustomErrorsSection.cs
- RangeValueProviderWrapper.cs
- EditorZoneBase.cs
- ListViewItemEventArgs.cs
- InheritanceContextHelper.cs
- TcpStreams.cs
- DataList.cs
- TextAction.cs
- StaticExtensionConverter.cs
- WinEventQueueItem.cs
- SafeLibraryHandle.cs
- serverconfig.cs
- ClientType.cs
- DateTimeOffsetStorage.cs
- CryptoProvider.cs
- EntitySetDataBindingList.cs
- InvariantComparer.cs
- Slider.cs
- ConnectionManagementSection.cs
- BinHexEncoder.cs
- TimeZone.cs
- FocusTracker.cs
- SafeSecurityHandles.cs
- SQLString.cs
- Helper.cs
- XhtmlBasicTextViewAdapter.cs
- ChtmlTextWriter.cs
- ProcessHostMapPath.cs
- JournalEntry.cs
- HtmlGenericControl.cs
- AssemblyInfo.cs
- ContentType.cs
- DiscoveryClientChannelFactory.cs
- MethodToken.cs
- SerializationInfoEnumerator.cs
- XmlBinaryReader.cs
- RequestStatusBarUpdateEventArgs.cs
- ArrayWithOffset.cs
- MultipleCopiesCollection.cs
- xmlsaver.cs
- ErrorInfoXmlDocument.cs
- AbstractDataSvcMapFileLoader.cs
- XPathExpr.cs
- FactoryGenerator.cs
- CodeTypeParameter.cs
- WebPartHelpVerb.cs
- FindRequestContext.cs
- ExceptionUtil.cs
- GeneralTransformGroup.cs
- InkCanvas.cs
- ListViewItem.cs
- Model3D.cs
- ReadContentAsBinaryHelper.cs
- UIPermission.cs
- PeerService.cs
- ScrollChrome.cs
- RangeBase.cs
- PropertyManager.cs
- util.cs
- XmlSchemaException.cs
- HatchBrush.cs
- FileLogRecordStream.cs
- InvalidTimeZoneException.cs
- HashHelper.cs
- XmlWriterTraceListener.cs
- TextAutomationPeer.cs
- CodeConstructor.cs
- ObjectMemberMapping.cs
- Debugger.cs
- ThemeableAttribute.cs
- PageParser.cs
- UriParserTemplates.cs
- Compiler.cs
- FileStream.cs
- ElementUtil.cs
- DataGridViewButtonColumn.cs
- MachineKeySection.cs
- DesignerActionUI.cs
- EUCJPEncoding.cs
- EntityModelSchemaGenerator.cs
- SourceSwitch.cs
- IIS7WorkerRequest.cs
- ProtectedConfiguration.cs
- Win32NamedPipes.cs
- QueryReaderSettings.cs
- StringFormat.cs
- GridItemCollection.cs
- DynamicQueryableWrapper.cs
- PageAsyncTaskManager.cs
- SqlClientFactory.cs
- FunctionOverloadResolver.cs
- UpdateCommandGenerator.cs
- SerializerDescriptor.cs
- SqlBuffer.cs
- RawKeyboardInputReport.cs