Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Design / Glyphs / CommentGlyph.cs / 1305376 / CommentGlyph.cs
namespace System.Workflow.ComponentModel.Design { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; #region Glyphs #region Class CommentGlyph //Class is internal but not sealed as we dont expect the ActivityDesigner writers to supply their own //Glyph instead based on comment property comment glyph is shown //Exception: StripItemCommentGlyph public class CommentGlyph : DesignerGlyph { private static CommentGlyph defaultCommentGlyph = null; internal static CommentGlyph Default { get { if (CommentGlyph.defaultCommentGlyph == null) CommentGlyph.defaultCommentGlyph = new CommentGlyph(); return CommentGlyph.defaultCommentGlyph; } } public override Rectangle GetBounds(ActivityDesigner designer, bool activated) { if (designer == null) throw new ArgumentNullException("designer"); Rectangle bounds = designer.Bounds; bounds.Inflate(WorkflowTheme.CurrentTheme.AmbientTheme.Margin); return bounds; } public override int Priority { get { return DesignerGlyph.CommentPriority; } } protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer) { Rectangle bounds = GetBounds(designer, activated); graphics.FillRectangle(AmbientTheme.FadeBrush, bounds); graphics.FillRectangle(ambientTheme.CommentIndicatorBrush, bounds); graphics.DrawRectangle(ambientTheme.CommentIndicatorPen, bounds); } } #endregion #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Workflow.ComponentModel.Design { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; #region Glyphs #region Class CommentGlyph //Class is internal but not sealed as we dont expect the ActivityDesigner writers to supply their own //Glyph instead based on comment property comment glyph is shown //Exception: StripItemCommentGlyph public class CommentGlyph : DesignerGlyph { private static CommentGlyph defaultCommentGlyph = null; internal static CommentGlyph Default { get { if (CommentGlyph.defaultCommentGlyph == null) CommentGlyph.defaultCommentGlyph = new CommentGlyph(); return CommentGlyph.defaultCommentGlyph; } } public override Rectangle GetBounds(ActivityDesigner designer, bool activated) { if (designer == null) throw new ArgumentNullException("designer"); Rectangle bounds = designer.Bounds; bounds.Inflate(WorkflowTheme.CurrentTheme.AmbientTheme.Margin); return bounds; } public override int Priority { get { return DesignerGlyph.CommentPriority; } } protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer) { Rectangle bounds = GetBounds(designer, activated); graphics.FillRectangle(AmbientTheme.FadeBrush, bounds); graphics.FillRectangle(ambientTheme.CommentIndicatorBrush, bounds); graphics.DrawRectangle(ambientTheme.CommentIndicatorPen, bounds); } } #endregion #endregion } // 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
- IgnoreFileBuildProvider.cs
- MemoryResponseElement.cs
- InstanceHandle.cs
- ExceptionUtility.cs
- OdbcInfoMessageEvent.cs
- StateRuntime.cs
- AppDomainFactory.cs
- StatusBar.cs
- SingleTagSectionHandler.cs
- XmlChildEnumerator.cs
- TextProperties.cs
- Rotation3DAnimation.cs
- SkinBuilder.cs
- DataServiceHostFactory.cs
- WsdlEndpointConversionContext.cs
- IgnoreSectionHandler.cs
- ConfigurationHandlersInstallComponent.cs
- XmlSchemaSequence.cs
- FixedSOMPageConstructor.cs
- DesignerTransactionCloseEvent.cs
- ObjectReaderCompiler.cs
- SynchronizedCollection.cs
- ClientSession.cs
- DataGridViewComboBoxCell.cs
- CollectionType.cs
- SelectionProviderWrapper.cs
- Lease.cs
- DefaultMemberAttribute.cs
- OneWayBindingElementImporter.cs
- GuidConverter.cs
- SqlUtils.cs
- PeerApplicationLaunchInfo.cs
- ApplicationSettingsBase.cs
- BaseTemplateParser.cs
- MaskedTextBoxTextEditor.cs
- BigInt.cs
- DataGridPageChangedEventArgs.cs
- RoleBoolean.cs
- ValueOfAction.cs
- CustomErrorsSectionWrapper.cs
- AnimatedTypeHelpers.cs
- IxmlLineInfo.cs
- ProcessModuleCollection.cs
- UserValidatedEventArgs.cs
- UniqueID.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DependsOnAttribute.cs
- TextTreeObjectNode.cs
- FrameworkElementAutomationPeer.cs
- DataGridViewDataConnection.cs
- Transform3DGroup.cs
- ClonableStack.cs
- PieceDirectory.cs
- ComponentResourceKeyConverter.cs
- MinimizableAttributeTypeConverter.cs
- CharStorage.cs
- ToolboxItem.cs
- SelectionUIHandler.cs
- DesignerDataRelationship.cs
- LinkArea.cs
- DependencyObjectType.cs
- IdnMapping.cs
- FamilyTypeface.cs
- ObfuscateAssemblyAttribute.cs
- FixedTextContainer.cs
- HostedNamedPipeTransportManager.cs
- XamlPointCollectionSerializer.cs
- EntityType.cs
- XmlText.cs
- AutoGeneratedField.cs
- TemplatePartAttribute.cs
- __ConsoleStream.cs
- InkPresenter.cs
- SocketSettings.cs
- ListViewDeletedEventArgs.cs
- Matrix3D.cs
- XmlReader.cs
- DeferredBinaryDeserializerExtension.cs
- Activity.cs
- ViewBase.cs
- SyndicationCategory.cs
- TextElementEnumerator.cs
- DictionaryCustomTypeDescriptor.cs
- ScriptServiceAttribute.cs
- EntityDataSourceConfigureObjectContext.cs
- CustomCredentialPolicy.cs
- SizeChangedInfo.cs
- MetadataCache.cs
- UnitySerializationHolder.cs
- InlinedLocationReference.cs
- MetaColumn.cs
- EventLogWatcher.cs
- HttpRawResponse.cs
- TextTreeFixupNode.cs
- PageCatalogPart.cs
- XmlMapping.cs
- CodeTryCatchFinallyStatement.cs
- ValueUtilsSmi.cs
- SafeBitVector32.cs
- XamlHostingConfiguration.cs