public override int GetHashCode()
        {
            unchecked
            {
                var hash = 17;

                hash = hash * 23 + Fields.GetHashCode();
                hash = hash * 23 + Properties.GetHashCode();
                hash = hash * 23 + Methods.GetHashCode();
                hash = hash * 23 + Constructors.GetHashCode();
                hash = hash * 23 + Gettable.GetHashCode();
                hash = hash * 23 + Settable.GetHashCode();
                hash = hash * 23 + Indexers.GetHashCode();
                hash = hash * 23 + Events.GetHashCode();

                hash = hash * 23 + Inherited.GetHashCode();
                hash = hash * 23 + Targeted.GetHashCode();
                hash = hash * 23 + NonTargeted.GetHashCode();
                hash = hash * 23 + Public.GetHashCode();
                hash = hash * 23 + NonPublic.GetHashCode();
                hash = hash * 23 + ReadOnly.GetHashCode();
                hash = hash * 23 + WriteOnly.GetHashCode();
                hash = hash * 23 + Extensions.GetHashCode();
                hash = hash * 23 + Operators.GetHashCode();
                hash = hash * 23 + Conversions.GetHashCode();
                hash = hash * 23 + Parameters.GetHashCode();
                hash = hash * 23 + Obsolete.GetHashCode();
                hash = hash * 23 + OpenConstructedGeneric.GetHashCode();
                hash = hash * 23 + TypeInitializers.GetHashCode();

                return(hash);
            }
        }
Esempio n. 2
0
        public void WriteOnlyTargetPropertyIsIgnored()
        {
            WriteOnly source = new WriteOnly {
                Value = "copied", Write = "ignored"
            };
            Simple target = PropertyCopy <Simple> .CopyFrom(source);

            Assert.AreEqual("copied", target.Value);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Ronly myread = new Ronly();
               Console.WriteLine(myread.ReadOnly);
               WriteOnly mywrite = new WriteOnly();
               mywrite.writemyname = "Pouria";
               mywrite.Display();

               Normal mynormal = new Normal();
               mynormal.Writedate(userName: "******", userAge: 31);
               mynormal.Displaydata();

               Console.ReadLine();
        }