Code:
/ FX-1434 / FX-1434 / 1.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
- DeclarativeCatalogPart.cs
- SqlParameter.cs
- ResourceBinder.cs
- TranslateTransform3D.cs
- ContextBase.cs
- DummyDataSource.cs
- BooleanKeyFrameCollection.cs
- TypeForwardedFromAttribute.cs
- StartFileNameEditor.cs
- MemberPath.cs
- RenderTargetBitmap.cs
- ScriptResourceInfo.cs
- AdRotator.cs
- ActivityTypeDesigner.xaml.cs
- ListSourceHelper.cs
- RawStylusActions.cs
- OneWayBindingElement.cs
- Timeline.cs
- XsdDateTime.cs
- ScriptControlManager.cs
- MenuRendererStandards.cs
- TextTrailingCharacterEllipsis.cs
- DataRelationCollection.cs
- COM2TypeInfoProcessor.cs
- BinaryMessageEncodingElement.cs
- NativeWindow.cs
- CompilerErrorCollection.cs
- TimeSpanOrInfiniteValidator.cs
- RequestSecurityToken.cs
- CellLabel.cs
- HtmlUtf8RawTextWriter.cs
- InterleavedZipPartStream.cs
- GridEntryCollection.cs
- EnumValAlphaComparer.cs
- TreeWalker.cs
- AutomationEventArgs.cs
- SequentialOutput.cs
- UseAttributeSetsAction.cs
- XmlName.cs
- Transform.cs
- RequestQueue.cs
- RelationshipEntry.cs
- ListenerConfig.cs
- xmlfixedPageInfo.cs
- HostExecutionContextManager.cs
- SqlExpressionNullability.cs
- WebPartDisplayModeEventArgs.cs
- FrameworkElementFactoryMarkupObject.cs
- StringUtil.cs
- ResXFileRef.cs
- ElementHostPropertyMap.cs
- FontWeightConverter.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ProvideValueServiceProvider.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- CombinedTcpChannel.cs
- SchemaElement.cs
- WebRequestModuleElementCollection.cs
- EffectiveValueEntry.cs
- ServiceMetadataContractBehavior.cs
- StylusEventArgs.cs
- HtmlControlPersistable.cs
- WorkflowTransactionService.cs
- RewritingSimplifier.cs
- WpfKnownType.cs
- UnsafeNativeMethods.cs
- LockRecoveryTask.cs
- AddressingProperty.cs
- MessageUtil.cs
- Attributes.cs
- WebHostUnsafeNativeMethods.cs
- SessionMode.cs
- AppendHelper.cs
- MeasureItemEvent.cs
- ConnectionStringsExpressionBuilder.cs
- FixedBufferAttribute.cs
- DefaultObjectMappingItemCollection.cs
- PrimitiveDataContract.cs
- ListViewPagedDataSource.cs
- SAPIEngineTypes.cs
- PeerToPeerException.cs
- MdImport.cs
- PathFigure.cs
- StandardOleMarshalObject.cs
- BufferedReadStream.cs
- SqlInternalConnectionTds.cs
- XmlFormatMapping.cs
- Char.cs
- DesignerVerbCollection.cs
- RuntimeConfigurationRecord.cs
- AttributeUsageAttribute.cs
- InputScope.cs
- DataRecordInfo.cs
- _Rfc2616CacheValidators.cs
- DesignerLoader.cs
- HandleCollector.cs
- TcpHostedTransportConfiguration.cs
- FontSource.cs
- DesignerAdapterUtil.cs
- WindowsTab.cs