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
- UnhandledExceptionEventArgs.cs
- TransactionInformation.cs
- DataGridViewCellValueEventArgs.cs
- TransformConverter.cs
- DbConvert.cs
- LocalBuilder.cs
- DoubleAnimationBase.cs
- FrameworkElement.cs
- GridErrorDlg.cs
- XpsFont.cs
- TablePattern.cs
- SettingsAttributeDictionary.cs
- InsufficientMemoryException.cs
- Graph.cs
- ToggleButtonAutomationPeer.cs
- DefaultParameterValueAttribute.cs
- SchemaNames.cs
- ArrangedElementCollection.cs
- EntityWrapperFactory.cs
- Transform.cs
- ControlBindingsCollection.cs
- XPSSignatureDefinition.cs
- TrackingRecord.cs
- ResourceDisplayNameAttribute.cs
- UIElementPropertyUndoUnit.cs
- ExpandSegment.cs
- Stylesheet.cs
- WebConfigurationManager.cs
- SocketInformation.cs
- XsdBuilder.cs
- NumericUpDown.cs
- BitSet.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- TrustManagerMoreInformation.cs
- TextRange.cs
- MailMessage.cs
- SapiRecognizer.cs
- VBCodeProvider.cs
- PostBackTrigger.cs
- HttpPostedFileBase.cs
- Parameter.cs
- XmlUtilWriter.cs
- PhonemeConverter.cs
- RulePatternOps.cs
- TextEffectCollection.cs
- externdll.cs
- TreeViewTemplateSelector.cs
- FontFamily.cs
- ResolveNameEventArgs.cs
- EqualityComparer.cs
- Win32Exception.cs
- ComponentEditorPage.cs
- InvalidAsynchronousStateException.cs
- AssemblyCollection.cs
- XXXOnTypeBuilderInstantiation.cs
- TdsParameterSetter.cs
- ImageCodecInfoPrivate.cs
- DbConnectionHelper.cs
- DataGridBoolColumn.cs
- StyleCollectionEditor.cs
- BitHelper.cs
- TypeSource.cs
- DispatchWrapper.cs
- ClosableStream.cs
- DocumentViewer.cs
- ToolboxComponentsCreatingEventArgs.cs
- WorkflowDispatchContext.cs
- CommonProperties.cs
- Switch.cs
- ConfigXmlAttribute.cs
- LineServicesRun.cs
- MenuItem.cs
- VideoDrawing.cs
- ProtectedConfigurationSection.cs
- VisualStyleRenderer.cs
- HttpProfileGroupBase.cs
- HtmlInputImage.cs
- DateTimeStorage.cs
- SupportingTokenAuthenticatorSpecification.cs
- _SslState.cs
- TypeSystem.cs
- TextRunTypographyProperties.cs
- BaseInfoTable.cs
- DbExpressionVisitor_TResultType.cs
- ExpandButtonVisibilityConverter.cs
- SqlBulkCopyColumnMapping.cs
- RelationshipEnd.cs
- StreamWriter.cs
- FixedTextView.cs
- ChtmlImageAdapter.cs
- JsonFormatGeneratorStatics.cs
- indexingfiltermarshaler.cs
- InputProcessorProfilesLoader.cs
- DeviceContexts.cs
- HybridDictionary.cs
- EntitySetRetriever.cs
- Utils.cs
- AuthenticationModuleElement.cs
- EntityClientCacheKey.cs
- XhtmlBasicSelectionListAdapter.cs