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
- XmlNodeList.cs
- NameValueCollection.cs
- ParserExtension.cs
- DummyDataSource.cs
- PageCodeDomTreeGenerator.cs
- PrintPreviewGraphics.cs
- CodeExpressionCollection.cs
- _ListenerRequestStream.cs
- WindowsStatusBar.cs
- SafeArrayRankMismatchException.cs
- Paragraph.cs
- JoinSymbol.cs
- UntrustedRecipientException.cs
- HandlerWithFactory.cs
- NetTcpSectionData.cs
- Funcletizer.cs
- TargetConverter.cs
- GridViewRow.cs
- SecurityUniqueId.cs
- XNameTypeConverter.cs
- RelationshipNavigation.cs
- mongolianshape.cs
- SecurityException.cs
- TextProperties.cs
- ParseChildrenAsPropertiesAttribute.cs
- ScriptReference.cs
- XmlNotation.cs
- TrustLevel.cs
- ImageListStreamer.cs
- Line.cs
- GeneralTransform3DGroup.cs
- DetailsViewDeleteEventArgs.cs
- LinqToSqlWrapper.cs
- BasicExpressionVisitor.cs
- CaseInsensitiveOrdinalStringComparer.cs
- LocalValueEnumerator.cs
- ErrorFormatter.cs
- xdrvalidator.cs
- Rule.cs
- wgx_commands.cs
- MimeTypeMapper.cs
- ObjectKeyFrameCollection.cs
- FixedTextSelectionProcessor.cs
- XMLDiffLoader.cs
- ListBoxAutomationPeer.cs
- DependencyPropertyConverter.cs
- SevenBitStream.cs
- SecurityState.cs
- DataServicePagingProviderWrapper.cs
- ConstructorNeedsTagAttribute.cs
- UmAlQuraCalendar.cs
- StreamUpdate.cs
- UnsafePeerToPeerMethods.cs
- AudioDeviceOut.cs
- DbDataSourceEnumerator.cs
- ColumnMap.cs
- PageContent.cs
- MdiWindowListItemConverter.cs
- StylusPointDescription.cs
- XmlSchemaComplexContentRestriction.cs
- ConnectorRouter.cs
- RectangleHotSpot.cs
- EntityDataSourceSelectedEventArgs.cs
- ChangeDirector.cs
- DomNameTable.cs
- RenderingBiasValidation.cs
- InternalSafeNativeMethods.cs
- EditorBrowsableAttribute.cs
- ProfessionalColors.cs
- EqualityComparer.cs
- DataSet.cs
- HttpClientCredentialType.cs
- CleanUpVirtualizedItemEventArgs.cs
- TraceEventCache.cs
- EditingCoordinator.cs
- XmlSchemaException.cs
- QueryConverter.cs
- DoubleStorage.cs
- XPathBinder.cs
- HuffModule.cs
- safelinkcollection.cs
- Attributes.cs
- ClientConfigurationSystem.cs
- ReversePositionQuery.cs
- HttpConfigurationSystem.cs
- DbMetaDataColumnNames.cs
- WindowsBrush.cs
- ETagAttribute.cs
- DecryptRequest.cs
- XmlBinaryWriter.cs
- ErrorEventArgs.cs
- FontStyles.cs
- AlternateViewCollection.cs
- HashAlgorithm.cs
- OracleBoolean.cs
- URI.cs
- ThreadPool.cs
- CallSiteOps.cs
- XmlSerializerFactory.cs
- CheckedPointers.cs