Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Design / Glyphs / ReadOnlyActivityGlyph.cs / 1305376 / ReadOnlyActivityGlyph.cs
namespace System.Workflow.ComponentModel.Design { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; #region Glyphs #region Class ReadOnlyActivityGlyph //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 ReadOnlyActivityGlyph : DesignerGlyph { 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.ReadOnlyGlyphPriority; } } protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer) { Rectangle bounds = GetBounds(designer, activated); bounds.Inflate(WorkflowTheme.CurrentTheme.AmbientTheme.Margin); ActivityDesignerPaint.DrawImage(graphics, AmbientTheme.ReadOnlyImage, bounds, DesignerContentAlignment.TopLeft); } } #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 ReadOnlyActivityGlyph //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 ReadOnlyActivityGlyph : DesignerGlyph { 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.ReadOnlyGlyphPriority; } } protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer) { Rectangle bounds = GetBounds(designer, activated); bounds.Inflate(WorkflowTheme.CurrentTheme.AmbientTheme.Margin); ActivityDesignerPaint.DrawImage(graphics, AmbientTheme.ReadOnlyImage, bounds, DesignerContentAlignment.TopLeft); } } #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
- BackgroundWorker.cs
- CssTextWriter.cs
- ChildTable.cs
- DataTableReaderListener.cs
- OpCodes.cs
- ThreadNeutralSemaphore.cs
- graph.cs
- ConfigurationPropertyCollection.cs
- EndpointConfigContainer.cs
- CheckBoxField.cs
- XmlFormatMapping.cs
- SpanIndex.cs
- FlowDocumentFormatter.cs
- DataGridViewCheckBoxColumn.cs
- DataObjectPastingEventArgs.cs
- VersionedStreamOwner.cs
- KeyConstraint.cs
- VariableExpressionConverter.cs
- ClientApiGenerator.cs
- NTAccount.cs
- DocumentSequence.cs
- RegexReplacement.cs
- uribuilder.cs
- ImageMetadata.cs
- HWStack.cs
- PackageRelationshipSelector.cs
- SplashScreenNativeMethods.cs
- FacetDescriptionElement.cs
- SystemDiagnosticsSection.cs
- GlyphCache.cs
- FormViewModeEventArgs.cs
- Point.cs
- XamlParser.cs
- DocumentDesigner.cs
- dsa.cs
- DataColumnPropertyDescriptor.cs
- ArgIterator.cs
- CatalogPartChrome.cs
- SplitterCancelEvent.cs
- Variant.cs
- AncestorChangedEventArgs.cs
- HtmlHistory.cs
- ImageDrawing.cs
- CounterSet.cs
- CodeDomSerializer.cs
- RecognizerStateChangedEventArgs.cs
- SerializerDescriptor.cs
- METAHEADER.cs
- JavaScriptSerializer.cs
- RawStylusInputReport.cs
- RelationshipType.cs
- Int32AnimationBase.cs
- MemoryFailPoint.cs
- UpDownBase.cs
- ImageListStreamer.cs
- OptimizerPatterns.cs
- ViewUtilities.cs
- BaseTemplateCodeDomTreeGenerator.cs
- ToolStripControlHost.cs
- PointConverter.cs
- TypeBuilderInstantiation.cs
- BitmapFrameDecode.cs
- SchemaType.cs
- WebPartConnectionsDisconnectVerb.cs
- RoutingUtilities.cs
- BooleanFacetDescriptionElement.cs
- TagPrefixInfo.cs
- ResourceDictionary.cs
- AmbientLight.cs
- Int32EqualityComparer.cs
- AdRotator.cs
- ProtocolImporter.cs
- ManualWorkflowSchedulerService.cs
- WindowsAuthenticationModule.cs
- SqlMethodTransformer.cs
- AggregateNode.cs
- XmlQualifiedName.cs
- ActivityXRefPropertyEditor.cs
- ThrowHelper.cs
- DataGridViewRowPostPaintEventArgs.cs
- ControlAdapter.cs
- Size.cs
- SqlTriggerContext.cs
- SeparatorAutomationPeer.cs
- versioninfo.cs
- X509CertificateCollection.cs
- COSERVERINFO.cs
- TypeDescriptor.cs
- ProfileSettingsCollection.cs
- LockedHandleGlyph.cs
- TabControlAutomationPeer.cs
- XslVisitor.cs
- WinEventWrap.cs
- BitmapEncoder.cs
- MetadataItemEmitter.cs
- UnsafePeerToPeerMethods.cs
- AutoCompleteStringCollection.cs
- PixelFormat.cs
- ControlAdapter.cs
- wmiprovider.cs