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
- ServiceElement.cs
- MemberPath.cs
- CreateUserErrorEventArgs.cs
- TextElementEditingBehaviorAttribute.cs
- ClientFormsAuthenticationCredentials.cs
- ThrowHelper.cs
- RecognitionEventArgs.cs
- InputMethodStateTypeInfo.cs
- NetWebProxyFinder.cs
- EntitySqlQueryCacheKey.cs
- PiiTraceSource.cs
- UnauthorizedAccessException.cs
- Root.cs
- DrawingImage.cs
- XmlDataSourceDesigner.cs
- UntypedNullExpression.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ExtensionFile.cs
- TextRangeEdit.cs
- HttpFileCollection.cs
- WebPartEditorOkVerb.cs
- CompileXomlTask.cs
- ReversePositionQuery.cs
- RuntimeIdentifierPropertyAttribute.cs
- _Rfc2616CacheValidators.cs
- ServiceHttpModule.cs
- PatternMatcher.cs
- SqlStream.cs
- QilTernary.cs
- Adorner.cs
- ImpersonationContext.cs
- StaticExtensionConverter.cs
- SecurityResources.cs
- SerializationStore.cs
- FixUp.cs
- TableRow.cs
- SystemSounds.cs
- DispatchChannelSink.cs
- NegationPusher.cs
- SoapCodeExporter.cs
- Imaging.cs
- MimeMapping.cs
- TogglePatternIdentifiers.cs
- CompilerWrapper.cs
- ExceptionUtil.cs
- WmlTextViewAdapter.cs
- AssemblyCollection.cs
- Visual3DCollection.cs
- UriParserTemplates.cs
- Animatable.cs
- SqlTrackingQuery.cs
- DurableInstanceProvider.cs
- DataSvcMapFile.cs
- _TransmitFileOverlappedAsyncResult.cs
- NativeCppClassAttribute.cs
- ToolStripContainerDesigner.cs
- GeneralTransform3DTo2DTo3D.cs
- UserCancellationException.cs
- LocationSectionRecord.cs
- ModelTreeEnumerator.cs
- SerializationHelper.cs
- WindowsFormsDesignerOptionService.cs
- RegexCompiler.cs
- XmlTextWriter.cs
- _Events.cs
- TextBreakpoint.cs
- DoubleLinkListEnumerator.cs
- RSAPKCS1SignatureDeformatter.cs
- StyleXamlParser.cs
- StringCollectionEditor.cs
- DataGridViewIntLinkedList.cs
- EdmProperty.cs
- RemotingServices.cs
- Stylesheet.cs
- Symbol.cs
- LinkUtilities.cs
- InvalidContentTypeException.cs
- WebPartUtil.cs
- UnauthorizedAccessException.cs
- XmlSchemas.cs
- ScrollViewer.cs
- RuntimeHelpers.cs
- SqlColumnizer.cs
- Closure.cs
- XmlSecureResolver.cs
- AudioFormatConverter.cs
- DatasetMethodGenerator.cs
- XPathArrayIterator.cs
- XPathSelfQuery.cs
- LogicalTreeHelper.cs
- TypeTypeConverter.cs
- TypeUtils.cs
- CodeIdentifier.cs
- SystemIPv6InterfaceProperties.cs
- SerializationException.cs
- IOException.cs
- MatrixStack.cs
- MarkupWriter.cs
- DataColumnMapping.cs
- DashStyle.cs