private static void DoKeyword1() { KeywordA a = new KeywordA(); a.Test(); a.Test1(); Console.WriteLine("========================="); KeywordB b = new KeywordB(); b.Test(); b.Test1(); a = new KeywordB(); a.Test(); a.Test1(); Console.WriteLine("========================="); KeywordC c = new KeywordC(); c.Test(); a = new KeywordC(); a.Test(); a.Test1(); Console.WriteLine("========================="); }
/// <summary> /// Create inequality operator for Keyword objects; allows expressions like {if (KeywordA != KeywordB)} to compare each member value instead of the object reference /// </summary> public static bool operator !=(Keyword KeywordA, Keyword KeywordB) { return(!KeywordA.Equals(KeywordB)); }