Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/13/10 04:37:49 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • implemented reviewers' comments
  • added additional plugins HeuristicLab.Evolutionary, HeuristicLab.Permutation, HeuristicLab.Selection, and HeuristicLab.Routing.TSP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/ChangedEventArgs.cs

    r2653 r2790  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using System.Collections.Generic;
    2424using System.Text;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Core {
     
    2829
    2930  public class ChangedEventArgs : EventArgs {
    30     private class ReferenceEqualityComparer : IEqualityComparer<object> {
    31       bool IEqualityComparer<object>.Equals(object x, object y) {
    32         return object.ReferenceEquals(x, y);
    33       }
    34 
    35       int IEqualityComparer<object>.GetHashCode(object obj) {
    36         if (obj == null) return 0;
    37         return obj.GetHashCode();
    38       }
    39     }
    40 
    4131    private HashSet<object> changedObjects;
    4232
    4333    public ChangedEventArgs() {
    44       changedObjects = new HashSet<object>(new ReferenceEqualityComparer());
     34      changedObjects = new HashSet<object>(new ReferenceEqualityComparer<object>());
     35    }
     36    public ChangedEventArgs(IEnumerable<object> collection) {
     37      changedObjects = new HashSet<object>(collection, new ReferenceEqualityComparer<object>());
    4538    }
    4639
Note: See TracChangeset for help on using the changeset viewer.