Code:
/ DotNET / DotNET / 8.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
- ScriptHandlerFactory.cs
- TemplateKey.cs
- ProjectionPlan.cs
- DataBoundControlAdapter.cs
- CommandID.cs
- Compensate.cs
- FileDataSource.cs
- BaseConfigurationRecord.cs
- ObsoleteAttribute.cs
- LiteralControl.cs
- ListQueryResults.cs
- EntityDataSourceUtil.cs
- DependencyPropertyDescriptor.cs
- WindowShowOrOpenTracker.cs
- HandlerFactoryCache.cs
- EventSetter.cs
- InboundActivityHelper.cs
- ScriptingRoleServiceSection.cs
- LocationInfo.cs
- NotSupportedException.cs
- SmiEventSink_Default.cs
- ObjectSet.cs
- SingleTagSectionHandler.cs
- SafeFileMapViewHandle.cs
- NodeInfo.cs
- util.cs
- RadioButtonFlatAdapter.cs
- TextStore.cs
- EntityDesignerBuildProvider.cs
- Size.cs
- GlyphRun.cs
- KnownTypesProvider.cs
- DataBoundControlHelper.cs
- IsolatedStorageFileStream.cs
- LinqTreeNodeEvaluator.cs
- SecurityTokenSerializer.cs
- TextRunTypographyProperties.cs
- MessageQueueKey.cs
- SiteOfOriginContainer.cs
- DockPanel.cs
- ProcessHostMapPath.cs
- FixedDocumentSequencePaginator.cs
- UnknownBitmapDecoder.cs
- EntityModelSchemaGenerator.cs
- XamlToRtfWriter.cs
- SelectQueryOperator.cs
- wgx_sdk_version.cs
- SR.Designer.cs
- SettingsPropertyCollection.cs
- SoapServerProtocol.cs
- ConnectivityStatus.cs
- SortExpressionBuilder.cs
- Automation.cs
- HandleExceptionArgs.cs
- CodeMemberEvent.cs
- DrawTreeNodeEventArgs.cs
- CollectionsUtil.cs
- DataGridCommandEventArgs.cs
- RegionInfo.cs
- XmlTextEncoder.cs
- PopOutPanel.cs
- AxisAngleRotation3D.cs
- DataControlButton.cs
- AdornerPresentationContext.cs
- TableChangeProcessor.cs
- SchemaConstraints.cs
- BinHexEncoder.cs
- PackageStore.cs
- MaskedTextBoxTextEditorDropDown.cs
- XPathSingletonIterator.cs
- TypeSource.cs
- UrlPath.cs
- COM2PropertyDescriptor.cs
- XhtmlBasicTextViewAdapter.cs
- BaseComponentEditor.cs
- NullableLongAverageAggregationOperator.cs
- PassportAuthenticationEventArgs.cs
- AppDomainFactory.cs
- CollectionTraceRecord.cs
- TransportChannelListener.cs
- RbTree.cs
- JumpPath.cs
- XmlSchemaException.cs
- AsyncPostBackErrorEventArgs.cs
- CodeDelegateInvokeExpression.cs
- HttpListenerRequest.cs
- IncomingWebResponseContext.cs
- KeyedPriorityQueue.cs
- VideoDrawing.cs
- DBBindings.cs
- Calendar.cs
- ConsoleKeyInfo.cs
- HtmlAnchor.cs
- WorkflowControlEndpoint.cs
- TextProviderWrapper.cs
- WindowsGrip.cs
- FieldBuilder.cs
- _SslSessionsCache.cs
- WebPartTransformer.cs
- RemoteHelper.cs