Beispiel #1
0
        /// <summary>
        /// Compares two AddressBookEntry objects
        /// </summary>
        public static bool operator !=(SimpleContactCard Address1, SimpleContactCard Address2)
        {
            string x, y;

            if (((object)Address1) == null)
            {
                return(((object)Address2) != null);
            }
            else if (((object)Address2) == null)
            {
                return(((object)Address1) != null);
            }

            try
            { x = Address1.ToString(); }
            catch (NullReferenceException ex)
            {
                string temp = ex.Message;
                x = "null";
            }

            try
            { y = Address2.ToString(); }
            catch (NullReferenceException ex)
            {
                string temp = ex.Message;
                y = "null";
            }

            return(x != y);
        }
Beispiel #2
0
        /// <summary>
        /// Compares two AddressBookEntry objects
        /// </summary>
        public static bool operator ==(AddressBookEntry Address1, AddressBookEntry Address2)
        {
            string x, y;

            if (((object)Address1) == null)
            {
                return(((object)Address2) == null);
            }
            else if (((object)Address2) == null)
            {
                return(((object)Address1) == null);
            }

            try
            { x = Address1.ToString(); }
            catch (NullReferenceException ex)
            {
                string temp = ex.Message;
                x = "null";
            }

            try
            { y = Address2.ToString(); }
            catch (NullReferenceException ex)
            {
                string temp = ex.Message;
                y = "null";
            }

            return(x == y);
        }
        public override string GenerateCodeString()
        {
            if (Label == null)
            {
                return("");
            }

            return($"if {Address1.ToString()} {RelOp} {Address2.ToString()} goto {Label.ToString()}");
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Address add1 = new Address("61044", "Kharkov", "Kobchino", "abc");

            //Employee inst1 = new Employee();


            //System.Console.WriteLine("PostIndex", inst.PostIndex);
            //System.Console.WriteLine(inst.PostIndex);

            System.Console.WriteLine(add1.ToString());

            Address2 add2 = new Address2("61044", "Kharkov", "Kobchino", "abc", "42");

            System.Console.WriteLine(add2.ToString());

            Console.WriteLine("add1==add2 " + (add1 == add2));

            Console.WriteLine("add1==add2 Equals " + (add1.Equals(add2)));
        }
Beispiel #5
0
        /// <summary>
        /// Compares two PostalAddress objects
        /// </summary>
        public static bool operator !=(PostalAddress Address1, PostalAddress Address2)
        {
            string x, y;

            if (Address1 is null)
            {
                x = "null";
            }
            else
            {
                x = Address1.ToString();
            }

            if (Address2 is null)
            {
                y = "null";
            }
            else
            {
                y = Address2.ToString();
            }

            return(x != y);
        }
Beispiel #6
0
 public override string GenerateCodeString()
 {
     return($"{Address3.ToString()} = {Address1.ToString()} + {Address2.ToString()}");
 }