Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / Glyph.cs / 1 / Glyph.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.Diagnostics.CodeAnalysis; using System.Drawing; using System.Windows.Forms.Design; ////// /// A Glyph represents a single UI entity managed by an Adorner. A Glyph /// does not have an HWnd - and is rendered on the BehaviorService's /// AdornerWindow control. Each Glyph can have a Behavior associated with /// it - the idea here is that a successfully Hit-Tested Glyph has the /// opportunity to 'push' a new/different Behavior onto the BehaviorService's /// BehaviorStack. Note that all Glyphs really do is paint and hit test. /// public abstract class Glyph { private Behavior behavior;//the Behaivor associated with the Glyph - can be null. ////// /// Glyph's default constructor takes a Behavior. /// protected Glyph(Behavior behavior) { this.behavior = behavior; } ////// /// This read-only property will return the Behavior associated with /// this Glyph. The Behavior can be null. /// public virtual Behavior Behavior{ get { return behavior; } } ////// /// This read-only property will return the Bounds associated with /// this Glyph. The Bounds can be empty. /// public virtual Rectangle Bounds { get { return Rectangle.Empty; } } ////// /// Abstract method that forces Glyph implementations to provide /// hit test logic. Given any point - if the Glyph has decided to /// be involved with that location, the Glyph will need to return /// a valid Cursor. Otherwise, returning null will cause the /// the BehaviorService to simply ignore it. /// public abstract Cursor GetHitTest(Point p); ////// /// Abstract method that forces Glyph implementations to provide /// paint logic. The PaintEventArgs object passed into this method /// contains the Graphics object related to the BehaviorService's /// AdornerWindow. /// public abstract void Paint(PaintEventArgs pe); ////// /// This method is called by inheriting classes to change the /// Behavior object associated with the Glyph. /// [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] protected void SetBehavior(Behavior behavior) { this.behavior = behavior; } } } // 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
- storepermission.cs
- XPathNavigatorKeyComparer.cs
- InkCanvasFeedbackAdorner.cs
- LineServices.cs
- ContentPropertyAttribute.cs
- XmlTextReaderImpl.cs
- TextLineBreak.cs
- Substitution.cs
- SetterBaseCollection.cs
- ExtendedProperty.cs
- LocatorManager.cs
- PerfCounterSection.cs
- HttpDictionary.cs
- RowVisual.cs
- HyperLink.cs
- TextEditorCopyPaste.cs
- TypeNameConverter.cs
- ByteConverter.cs
- ActiveXSite.cs
- StoragePropertyMapping.cs
- SafeRightsManagementEnvironmentHandle.cs
- LogicalExpr.cs
- InstanceHandleReference.cs
- NavigationService.cs
- CacheOutputQuery.cs
- XNameTypeConverter.cs
- UIElementHelper.cs
- AppearanceEditorPart.cs
- DefaultAssemblyResolver.cs
- KernelTypeValidation.cs
- MissingMethodException.cs
- Relationship.cs
- SendActivityValidator.cs
- MbpInfo.cs
- CountAggregationOperator.cs
- SiteMapDataSourceView.cs
- ErrorTableItemStyle.cs
- AuthenticodeSignatureInformation.cs
- IdentityManager.cs
- ProtocolsSection.cs
- ForwardPositionQuery.cs
- DataGridView.cs
- Animatable.cs
- DynamicActivityTypeDescriptor.cs
- RedirectionProxy.cs
- SystemIPAddressInformation.cs
- RSAProtectedConfigurationProvider.cs
- WinFormsComponentEditor.cs
- GradientStop.cs
- DecimalMinMaxAggregationOperator.cs
- StorageEndPropertyMapping.cs
- AttachInfo.cs
- ToolStripPanelRow.cs
- QueryInterceptorAttribute.cs
- EntitySqlQueryCacheKey.cs
- IResourceProvider.cs
- RefreshEventArgs.cs
- PackageDigitalSignature.cs
- XmlExtensionFunction.cs
- ResXResourceWriter.cs
- Camera.cs
- Parser.cs
- httpapplicationstate.cs
- WebPartVerbsEventArgs.cs
- DataSourceComponent.cs
- SoapInteropTypes.cs
- LinkButton.cs
- RelationshipConverter.cs
- LongTypeConverter.cs
- DataColumnCollection.cs
- DelegateSerializationHolder.cs
- ProfileGroupSettings.cs
- ProcessHostConfigUtils.cs
- CommandConverter.cs
- ServiceMetadataBehavior.cs
- Claim.cs
- SqlDataSourceCache.cs
- PassportAuthenticationModule.cs
- XmlExtensionFunction.cs
- LinqDataSourceDeleteEventArgs.cs
- Serializer.cs
- PackWebRequestFactory.cs
- SiteMapSection.cs
- SBCSCodePageEncoding.cs
- PageContentCollection.cs
- DockProviderWrapper.cs
- TrackingStringDictionary.cs
- BindingListCollectionView.cs
- BufferCache.cs
- MetadataAssemblyHelper.cs
- XmlTextReaderImpl.cs
- FontDifferentiator.cs
- PenThreadPool.cs
- SqlDataSourceSelectingEventArgs.cs
- FilteredAttributeCollection.cs
- SamlSecurityTokenAuthenticator.cs
- iisPickupDirectory.cs
- QuaternionAnimation.cs
- _NetworkingPerfCounters.cs
- DefaultValueConverter.cs