ImmutableObjectAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / ImmutableObjectAttribute.cs / 1 / ImmutableObjectAttribute.cs

                            namespace System.ComponentModel {
    using System;
    using System.Diagnostics;
    using System.Security.Permissions; 

    ///  
    ///  Specifies that a object has no sub properties that are editable. 
    /// 
    [AttributeUsage(AttributeTargets.All)] 
    public sealed class ImmutableObjectAttribute : Attribute {

         /// 
         ///  Specifies that a object has no sub properties that are editable. 
         ///
         ///  This is usually used in the properties window to determine if an expandable object 
         ///  should be rendered as read-only. 
         /// 
         public static readonly ImmutableObjectAttribute Yes = new ImmutableObjectAttribute(true); 

         /// 
         ///  Specifies that a object has at least one editable sub-property.
         /// 
         ///  This is usually used in the properties window to determine if an expandable object
         ///  should be rendered as read-only. 
         ///  
         public static readonly ImmutableObjectAttribute No = new ImmutableObjectAttribute(false);
 

         /// 
         ///  Defaults to ImmutableObjectAttribute.No
         ///  
         public static readonly ImmutableObjectAttribute Default = No;
 
         private bool immutable = true; 

         ///  
         ///  Constructs an ImmutableObjectAttribute object.
         ///
         /// 
         public ImmutableObjectAttribute(bool immutable) { 
            this.immutable = immutable;
         } 
 
         /// 
         ///    [To be supplied.] 
         /// 
         public bool Immutable {
             get {
               return immutable; 
             }
         } 
 
         /// 
         ///  
         /// 
         public override bool Equals(object obj) {
            if (obj == this) {
                return true; 
            }
 
            ImmutableObjectAttribute other = obj as ImmutableObjectAttribute; 
            return other != null && other.Immutable == this.immutable;
         } 

         /// 
         ///    
         ///       Returns the hashcode for this object. 
         ///    
         ///  
         public override int GetHashCode() { 
             return base.GetHashCode();
         } 

         /// 
         /// 
         ///  
         public override bool IsDefaultAttribute() {
            return (this.Equals(Default)); 
         } 

    } 
}
                        

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