コード例 #1
0
        protected override MergeResult DoMerge(Operation operation)
        {
            if (base.DoMerge(operation) == MergeResult.Stop)
            {
                return(MergeResult.Stop);
            }

            if (operation is RenameColumnOperation otherAsRenameColumnOp &&
                NewName.Equals(otherAsRenameColumnOp.Name, StringComparison.InvariantCultureIgnoreCase))
            {
                NewName = otherAsRenameColumnOp.NewName;
                otherAsRenameColumnOp.Disabled = true;
                return(MergeResult.Continue);
            }

            return(MergeResult.Continue);
        }
コード例 #2
0
 public static void Main()
 {
     NewName president = new NewName ("George", "Washington");
     NewName first = new NewName ("George", "Washington");
     Console.WriteLine
             ("Should be equal, but Equals returns: {0}",                                        first.Equals(president));
     Console.Write
          ("The hash codes for first and president are: ");
     if (president.GetHashCode() == first.GetHashCode())
        Console.WriteLine("equal");
     else
        Console.WriteLine("not equal");
     Dictionary<NewName, String> m = new Dictionary<NewName, String>();
     m.Add(president, "first");
     Console.WriteLine
      ("Should contain George Washington, and ContainsKey returns: "
                                        + m.ContainsKey(first));
     Console.WriteLine
     ("Should find 'first', and m[first] returns: "
                                               + m[first]);
     Console.WriteLine
        ("ToString overridden so first is: " + first);
 }