LockedActivityGlyph.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Design / Glyphs / LockedActivityGlyph.cs / 1305376 / LockedActivityGlyph.cs

                            namespace System.Workflow.ComponentModel.Design 
{
    using System;
    using System.Drawing;
    using System.Drawing.Drawing2D; 
    using System.Windows.Forms;
 
    #region Glyphs 

 
    #region Class LockedActivityGlyph
    //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 LockedActivityGlyph : DesignerGlyph
    { 
        private static LockedActivityGlyph defaultLockedGlyph = null; 

        internal static LockedActivityGlyph Default 
        {
            get
            {
                if (LockedActivityGlyph.defaultLockedGlyph == null) 
                    LockedActivityGlyph.defaultLockedGlyph = new LockedActivityGlyph();
                return LockedActivityGlyph.defaultLockedGlyph; 
            } 
        }
 
        public LockedActivityGlyph()
        {
        }
 
        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.LockedGlyphPriority;
            }
        }
 
        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.LockImage, 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

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK