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
- ToolstripProfessionalRenderer.cs
- FormsAuthenticationUser.cs
- SqlBuilder.cs
- ZoneMembershipCondition.cs
- Effect.cs
- ControlParameter.cs
- Light.cs
- StringCollection.cs
- MemberCollection.cs
- SrgsElementFactoryCompiler.cs
- IntSecurity.cs
- UmAlQuraCalendar.cs
- DataKey.cs
- SignatureHelper.cs
- WpfWebRequestHelper.cs
- CopyCodeAction.cs
- MachineSettingsSection.cs
- MenuItemCollectionEditorDialog.cs
- LambdaCompiler.Generated.cs
- FolderLevelBuildProvider.cs
- Int16Animation.cs
- MouseGestureValueSerializer.cs
- DrawListViewColumnHeaderEventArgs.cs
- SelectionPattern.cs
- MILUtilities.cs
- RegisteredScript.cs
- ByteViewer.cs
- DataGridItemAutomationPeer.cs
- WebPartDescriptionCollection.cs
- NetMsmqSecurityMode.cs
- HiddenFieldPageStatePersister.cs
- IDReferencePropertyAttribute.cs
- HtmlTableCellCollection.cs
- EmptyStringExpandableObjectConverter.cs
- GridView.cs
- BitmapImage.cs
- PermissionSetTriple.cs
- StringBuilder.cs
- X509Certificate.cs
- PriorityChain.cs
- XPathChildIterator.cs
- WindowVisualStateTracker.cs
- XamlParser.cs
- SwitchAttribute.cs
- SchemaRegistration.cs
- XmlLanguage.cs
- UiaCoreApi.cs
- NavigatorOutput.cs
- OdbcConnectionPoolProviderInfo.cs
- BindingNavigator.cs
- SafeRegistryHandle.cs
- ProtectedConfiguration.cs
- PathSegmentCollection.cs
- PrefixQName.cs
- TagNameToTypeMapper.cs
- AssociationSet.cs
- FaultConverter.cs
- returneventsaver.cs
- DayRenderEvent.cs
- AnimationClock.cs
- DbQueryCommandTree.cs
- ImplicitInputBrush.cs
- PnrpPeerResolverElement.cs
- XmlIterators.cs
- EdmComplexPropertyAttribute.cs
- RawTextInputReport.cs
- DataService.cs
- HttpEncoderUtility.cs
- EncoderReplacementFallback.cs
- IsolatedStorageSecurityState.cs
- MenuBase.cs
- TextParagraphCache.cs
- DataGridViewLayoutData.cs
- CursorConverter.cs
- DataComponentMethodGenerator.cs
- Pair.cs
- ClientScriptManager.cs
- Vector3D.cs
- ConfigXmlCDataSection.cs
- FocusTracker.cs
- StoreContentChangedEventArgs.cs
- ImportOptions.cs
- HeaderedItemsControl.cs
- MemoryRecordBuffer.cs
- WebPartConnectionsCancelVerb.cs
- DocumentPageTextView.cs
- ReverseComparer.cs
- MD5.cs
- FrameworkElement.cs
- PasswordBoxAutomationPeer.cs
- ValueSerializerAttribute.cs
- ZipPackagePart.cs
- PeerToPeerException.cs
- SizeConverter.cs
- ColumnResizeAdorner.cs
- WindowsStartMenu.cs
- SelectionProcessor.cs
- CodeRemoveEventStatement.cs
- XsltContext.cs
- LineGeometry.cs