Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Design / Glyphs / ShadowGlyph.cs / 1305376 / ShadowGlyph.cs
namespace System.Workflow.ComponentModel.Design { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; #region Glyphs #region Class ShadowGlyph public sealed class ShadowGlyph : DesignerGlyph { private static ShadowGlyph defaultShadowGlyph = null; internal static ShadowGlyph Default { get { if (defaultShadowGlyph == null) defaultShadowGlyph = new ShadowGlyph(); return defaultShadowGlyph; } } public override Rectangle GetBounds(ActivityDesigner designer, bool activated) { if (designer == null) throw new ArgumentNullException("designer"); Rectangle bounds = designer.Bounds; bounds.Inflate(AmbientTheme.DropShadowWidth + 1, AmbientTheme.DropShadowWidth + 1); return bounds; } protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer) { Rectangle bounds = GetBounds(designer, activated); if (!bounds.Size.IsEmpty) { bool drawRounded = (designer.DesignerTheme.DesignerGeometry == DesignerGeometry.RoundedRectangle && !designer.IsRootDesigner); ActivityDesignerPaint.DrawDropShadow(graphics, designer.Bounds, designer.DesignerTheme.BorderPen.Color, AmbientTheme.DropShadowWidth, LightSourcePosition.Left | LightSourcePosition.Top, 0.5f, drawRounded); } } public override int Priority { get { return DesignerGlyph.LowestPriority; } } } #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 ShadowGlyph public sealed class ShadowGlyph : DesignerGlyph { private static ShadowGlyph defaultShadowGlyph = null; internal static ShadowGlyph Default { get { if (defaultShadowGlyph == null) defaultShadowGlyph = new ShadowGlyph(); return defaultShadowGlyph; } } public override Rectangle GetBounds(ActivityDesigner designer, bool activated) { if (designer == null) throw new ArgumentNullException("designer"); Rectangle bounds = designer.Bounds; bounds.Inflate(AmbientTheme.DropShadowWidth + 1, AmbientTheme.DropShadowWidth + 1); return bounds; } protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer) { Rectangle bounds = GetBounds(designer, activated); if (!bounds.Size.IsEmpty) { bool drawRounded = (designer.DesignerTheme.DesignerGeometry == DesignerGeometry.RoundedRectangle && !designer.IsRootDesigner); ActivityDesignerPaint.DrawDropShadow(graphics, designer.Bounds, designer.DesignerTheme.BorderPen.Color, AmbientTheme.DropShadowWidth, LightSourcePosition.Left | LightSourcePosition.Top, 0.5f, drawRounded); } } public override int Priority { get { return DesignerGlyph.LowestPriority; } } } #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
- SecurityHelper.cs
- Rules.cs
- DbConnectionPoolGroupProviderInfo.cs
- HyperLink.cs
- BitmapEffectRenderDataResource.cs
- LinqToSqlWrapper.cs
- CustomErrorCollection.cs
- IPPacketInformation.cs
- CorrelationManager.cs
- Code.cs
- ClipboardProcessor.cs
- PeerToPeerException.cs
- QueryContinueDragEvent.cs
- securestring.cs
- ECDiffieHellmanPublicKey.cs
- CachedPathData.cs
- ToolStripItemRenderEventArgs.cs
- HttpDigestClientCredential.cs
- _HelperAsyncResults.cs
- KeySplineConverter.cs
- ProcessingInstructionAction.cs
- ToolStripSettings.cs
- XPathNode.cs
- ObjectViewQueryResultData.cs
- BoolExpressionVisitors.cs
- DesignDataSource.cs
- cookie.cs
- ToolStripContainer.cs
- DeriveBytes.cs
- TraceEventCache.cs
- OleDbException.cs
- AppDomainFactory.cs
- ListViewCommandEventArgs.cs
- CFGGrammar.cs
- ProcessInputEventArgs.cs
- GuidConverter.cs
- SmtpTransport.cs
- SHA1Managed.cs
- InstanceDataCollectionCollection.cs
- XmlnsCompatibleWithAttribute.cs
- StrongNameUtility.cs
- InvariantComparer.cs
- XPathExpr.cs
- CollectionEditorDialog.cs
- DetailsViewDeletedEventArgs.cs
- StatusBarItemAutomationPeer.cs
- CollectionExtensions.cs
- InternalTypeHelper.cs
- DataControlFieldCollection.cs
- IPAddress.cs
- CellQuery.cs
- BinaryObjectReader.cs
- XmlCharacterData.cs
- DefaultPrintController.cs
- OleAutBinder.cs
- EditorAttribute.cs
- WorkflowServiceInstance.cs
- LeafCellTreeNode.cs
- InputScope.cs
- ComponentEditorPage.cs
- SafeProcessHandle.cs
- MissingMemberException.cs
- LineBreak.cs
- ListBoxItem.cs
- DbCommandTree.cs
- TrackingConditionCollection.cs
- WebPartCancelEventArgs.cs
- EdgeProfileValidation.cs
- RadioButtonStandardAdapter.cs
- CapabilitiesState.cs
- QuaternionRotation3D.cs
- UnsafeNativeMethods.cs
- QueryContinueDragEvent.cs
- SchemaImporterExtension.cs
- CachingParameterInspector.cs
- TextPointer.cs
- DataGridCommandEventArgs.cs
- GPPOINT.cs
- AttachedAnnotationChangedEventArgs.cs
- TickBar.cs
- ZipIOExtraFieldElement.cs
- BinaryFormatterSinks.cs
- FileNotFoundException.cs
- DrawingAttributes.cs
- DataGrid.cs
- MSHTMLHost.cs
- SchemaImporterExtensionElement.cs
- PointConverter.cs
- Journaling.cs
- ImageAttributes.cs
- xmlformatgeneratorstatics.cs
- ModuleConfigurationInfo.cs
- XmlElementCollection.cs
- ArrangedElement.cs
- ProcessModuleCollection.cs
- Clause.cs
- IndexerNameAttribute.cs
- RequestStatusBarUpdateEventArgs.cs
- IRCollection.cs
- PropertyAccessVisitor.cs