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
- X509SecurityTokenAuthenticator.cs
- TypeReference.cs
- HybridObjectCache.cs
- StrokeCollection.cs
- XmlSchemaExporter.cs
- PathGeometry.cs
- TableLayoutColumnStyleCollection.cs
- CallbackBehaviorAttribute.cs
- InlineUIContainer.cs
- DataColumnMapping.cs
- ColumnResizeAdorner.cs
- KeyValueConfigurationElement.cs
- NullableDecimalAverageAggregationOperator.cs
- XPathBinder.cs
- ToolTipAutomationPeer.cs
- ActivityDesigner.cs
- MemoryMappedViewAccessor.cs
- NegatedConstant.cs
- EventLogPermission.cs
- RegexInterpreter.cs
- PointAnimationClockResource.cs
- PeerPresenceInfo.cs
- XsltLoader.cs
- WebOperationContext.cs
- CookielessHelper.cs
- Image.cs
- PersonalizationAdministration.cs
- AuthenticationModulesSection.cs
- HtmlTableRowCollection.cs
- UrlPath.cs
- Component.cs
- EntityKey.cs
- AssemblyAttributes.cs
- X509ChainPolicy.cs
- XmlILConstructAnalyzer.cs
- SqlGatherConsumedAliases.cs
- WebPartDescription.cs
- UdpSocketReceiveManager.cs
- ControlSerializer.cs
- AutomationEvent.cs
- InkCanvasAutomationPeer.cs
- RuleSetReference.cs
- LinqDataSourceHelper.cs
- BCryptNative.cs
- ByteStreamMessageUtility.cs
- OracleBoolean.cs
- WebHttpElement.cs
- TouchFrameEventArgs.cs
- GestureRecognizer.cs
- SqlParameterCollection.cs
- GeneralTransform3D.cs
- HashSetDebugView.cs
- ConfigurationElement.cs
- pingexception.cs
- UIElement3DAutomationPeer.cs
- CodeSubDirectory.cs
- TextTreeText.cs
- IdentityValidationException.cs
- ValueType.cs
- Scene3D.cs
- LinqDataSourceValidationException.cs
- HttpSessionStateBase.cs
- BrowserCapabilitiesFactoryBase.cs
- Delay.cs
- DocobjHost.cs
- Condition.cs
- ParameterDataSourceExpression.cs
- EventLogPermission.cs
- FileChangeNotifier.cs
- KeyboardEventArgs.cs
- ZipIOLocalFileBlock.cs
- AdCreatedEventArgs.cs
- HandlerBase.cs
- PathFigure.cs
- Operand.cs
- InternalTransaction.cs
- SQLBytes.cs
- StringUtil.cs
- TrayIconDesigner.cs
- HwndMouseInputProvider.cs
- ControlBuilder.cs
- ListViewItem.cs
- URL.cs
- TextEffect.cs
- FrameworkContextData.cs
- ExtenderControl.cs
- exports.cs
- SystemInformation.cs
- CodeSnippetTypeMember.cs
- ConfigurationValidatorBase.cs
- Camera.cs
- IPCCacheManager.cs
- TextEffect.cs
- PeoplePickerWrapper.cs
- MenuCommandService.cs
- UserUseLicenseDictionaryLoader.cs
- NameValuePermission.cs
- NativeMethods.cs
- SqlDependencyListener.cs
- SystemIcmpV4Statistics.cs