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
- DataPagerFieldItem.cs
- Debug.cs
- AssemblyAssociatedContentFileAttribute.cs
- initElementDictionary.cs
- AudioDeviceOut.cs
- StorageBasedPackageProperties.cs
- ProcessManager.cs
- SyndicationDeserializer.cs
- FlowStep.cs
- MailMessageEventArgs.cs
- PersonalizationProviderCollection.cs
- ListViewContainer.cs
- InvalidEnumArgumentException.cs
- CompilerScope.cs
- QualifiedCellIdBoolean.cs
- InputMethod.cs
- DrawListViewColumnHeaderEventArgs.cs
- FlowDocumentPage.cs
- SqlDependencyListener.cs
- ChooseAction.cs
- LocatorPart.cs
- TrustManagerMoreInformation.cs
- DesignerCategoryAttribute.cs
- EventToken.cs
- CodeVariableReferenceExpression.cs
- Signature.cs
- XmlSchemaValidationException.cs
- FileDialogPermission.cs
- FactoryGenerator.cs
- PublishLicense.cs
- TypeConverterHelper.cs
- DataPagerFieldItem.cs
- StdValidatorsAndConverters.cs
- XmlSecureResolver.cs
- ConnectorEditor.cs
- DataGridViewTopRowAccessibleObject.cs
- EventLogPermissionEntryCollection.cs
- DataControlFieldHeaderCell.cs
- SequenceFullException.cs
- processwaithandle.cs
- NamespaceList.cs
- IndexingContentUnit.cs
- XPathScanner.cs
- _LoggingObject.cs
- CommandConverter.cs
- DefaultShape.cs
- ButtonColumn.cs
- RegexStringValidator.cs
- SiteMapHierarchicalDataSourceView.cs
- StorageInfo.cs
- MenuBindingsEditorForm.cs
- TextLineBreak.cs
- FontConverter.cs
- SinglePageViewer.cs
- AutomationElementCollection.cs
- MetaModel.cs
- PrtCap_Public.cs
- QilTypeChecker.cs
- HandlerElementCollection.cs
- ReadOnlyCollection.cs
- XmlSchemaAll.cs
- ExpressionBuilder.cs
- TimeEnumHelper.cs
- AssemblyHash.cs
- StringBuilder.cs
- RuleRef.cs
- MailDefinition.cs
- XmlCompatibilityReader.cs
- ImpersonationContext.cs
- KeyboardNavigation.cs
- AutoScrollExpandMessageFilter.cs
- SecurityElement.cs
- XsltArgumentList.cs
- Pen.cs
- ClearTypeHintValidation.cs
- OSFeature.cs
- DetailsViewRowCollection.cs
- UniqueEventHelper.cs
- TextDecorationUnitValidation.cs
- TrackingWorkflowEventArgs.cs
- ResourcePart.cs
- Control.cs
- AuthenticateEventArgs.cs
- SHA1Managed.cs
- UrlPath.cs
- JpegBitmapDecoder.cs
- DesignerAttribute.cs
- OdbcConnectionOpen.cs
- VersionValidator.cs
- HttpModuleActionCollection.cs
- ParameterReplacerVisitor.cs
- MethodRental.cs
- SerializationEventsCache.cs
- ShaderEffect.cs
- EncryptedReference.cs
- MinimizableAttributeTypeConverter.cs
- TreeViewEvent.cs
- CaseInsensitiveComparer.cs
- HttpHandlerAction.cs
- Clause.cs