Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / LockedHandleGlyph.cs / 1 / LockedHandleGlyph.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;
using System.Runtime.InteropServices;
///
///
/// The LockedHandleGlyph represents the handle for a non-resizeable control in our new seleciton
/// model. Note that the pen and brush are created once per instance of this class
/// and re-used in our painting logic for perf. reasonse.
///
internal class LockedHandleGlyph : SelectionGlyphBase {
private bool isPrimary = false;
///
///
/// LockedHandleGlyph's constructor takes additional parameters: 'type' and 'primary selection'.
/// Also, we create/cache our pen & brush here to avoid this action with every paint message.
///
internal LockedHandleGlyph(Rectangle controlBounds, bool primarySelection) : base(null) {
isPrimary = primarySelection;
hitTestCursor = Cursors.Default;
rules = SelectionRules.None;
bounds = new Rectangle((controlBounds.X + DesignerUtils.LOCKHANDLEOVERLAP) - DesignerUtils.LOCKHANDLEWIDTH,
(controlBounds.Y + DesignerUtils.LOCKHANDLEOVERLAP) - DesignerUtils.LOCKHANDLEHEIGHT,
DesignerUtils.LOCKHANDLEWIDTH, DesignerUtils.LOCKHANDLEHEIGHT);
hitBounds = bounds;
}
///
///
/// Very simple paint logic.
///
public override void Paint(PaintEventArgs pe) {
DesignerUtils.DrawLockedHandle(pe.Graphics, bounds, isPrimary, this);
}
}
}
// 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
- XmlCDATASection.cs
- ListBase.cs
- FixedStringLookup.cs
- ObjectItemConventionAssemblyLoader.cs
- LineInfo.cs
- StrongNameUtility.cs
- XPSSignatureDefinition.cs
- GridViewItemAutomationPeer.cs
- ImageSourceConverter.cs
- ResourceDictionary.cs
- TextRangeEditTables.cs
- RenderCapability.cs
- DataControlField.cs
- TreeView.cs
- BamlWriter.cs
- BitmapCodecInfo.cs
- TabItemWrapperAutomationPeer.cs
- SectionInformation.cs
- Drawing.cs
- Bold.cs
- Environment.cs
- ItemCheckedEvent.cs
- infer.cs
- HierarchicalDataBoundControl.cs
- ToolStripManager.cs
- WebPartMinimizeVerb.cs
- ColumnCollection.cs
- FileSystemEventArgs.cs
- JavaScriptString.cs
- MapPathBasedVirtualPathProvider.cs
- Light.cs
- ListViewItem.cs
- ArgIterator.cs
- MouseBinding.cs
- ManagedIStream.cs
- DataPagerField.cs
- EventData.cs
- HyperLinkField.cs
- DataKey.cs
- XmlNamedNodeMap.cs
- User.cs
- ColumnReorderedEventArgs.cs
- TakeQueryOptionExpression.cs
- LocalizableAttribute.cs
- ThreadStaticAttribute.cs
- XmlObjectSerializerReadContextComplex.cs
- DocumentEventArgs.cs
- IOException.cs
- SchemaImporterExtensionElementCollection.cs
- SqlDataSourceSelectingEventArgs.cs
- Vector3DKeyFrameCollection.cs
- PassportAuthenticationEventArgs.cs
- IsolatedStorageFilePermission.cs
- BinarySerializer.cs
- TreeView.cs
- PixelShader.cs
- NotSupportedException.cs
- DataStorage.cs
- ObjectCacheHost.cs
- DependencyPropertyDescriptor.cs
- ContractBase.cs
- EventListenerClientSide.cs
- DataComponentNameHandler.cs
- RegexMatch.cs
- CombinedGeometry.cs
- BaseDataList.cs
- RegexRunnerFactory.cs
- StoreItemCollection.cs
- UnsafeNativeMethods.cs
- TemplateModeChangedEventArgs.cs
- EntityClassGenerator.cs
- RouteTable.cs
- EntityClassGenerator.cs
- ButtonChrome.cs
- TemplatedMailWebEventProvider.cs
- WebPartChrome.cs
- VisualTreeFlattener.cs
- CheckBoxFlatAdapter.cs
- SessionEndedEventArgs.cs
- QuaternionAnimation.cs
- EventArgs.cs
- GlyphRunDrawing.cs
- ToggleButton.cs
- ToolStripOverflow.cs
- DataRecordInternal.cs
- MiniMapControl.xaml.cs
- XmlSchemaSubstitutionGroup.cs
- SmtpNtlmAuthenticationModule.cs
- RectAnimationBase.cs
- ScrollPattern.cs
- MessagingDescriptionAttribute.cs
- Hex.cs
- DataGridRow.cs
- MetadataItemEmitter.cs
- PolyQuadraticBezierSegment.cs
- BaseTemplateCodeDomTreeGenerator.cs
- MD5CryptoServiceProvider.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- HwndPanningFeedback.cs
- ReferenceCountedObject.cs