Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/11 17:48:53 (13 years ago)
Author:
mkommend
Message:

#1479: Integrated trunk changes.

Location:
branches/GP.Grammar.Editor/HeuristicLab.Core/3.3
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Core/3.3/Collections/ItemSet.cs

    r5445 r6618  
    5454    public ItemSet() : base() { }
    5555    public ItemSet(IEnumerable<T> collection) : base(collection) { }
     56    public ItemSet(IEqualityComparer<T> comparer) : base(comparer) { }
     57    public ItemSet(IEnumerable<T> collection, IEqualityComparer<T> comparer) : base(collection, comparer) { }
    5658
    5759    public object Clone() {
  • branches/GP.Grammar.Editor/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj

    r6103 r6618  
    191191    <Compile Include="HeuristicLabCorePlugin.cs" />
    192192    <Compile Include="Properties\AssemblyInfo.cs" />
     193    <Compile Include="ThreadSafeLog.cs" />
    193194    <Compile Include="Variable.cs" />
    194195  </ItemGroup>
  • branches/GP.Grammar.Editor/HeuristicLab.Core/3.3/HeuristicLabCorePlugin.cs.frame

    r6099 r6618  
    2929  /// Plugin class for HeuristicLab.Core plugin.
    3030  /// </summary>
    31   [Plugin("HeuristicLab.Core", "3.3.4.$WCREV$")]
     31  [Plugin("HeuristicLab.Core", "3.3.5.$WCREV$")]
    3232  [PluginFile("HeuristicLab.Core-3.3.dll", PluginFileType.Assembly)]
    3333  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/GP.Grammar.Editor/HeuristicLab.Core/3.3/Log.cs

    r5445 r6618  
    4343    }
    4444
     45    [Storable]
     46    protected long maxMessageCount;
     47    public virtual long MaxMessageCount {
     48      get { return maxMessageCount; }
     49    }
     50
    4551    [StorableConstructor]
    4652    protected Log(bool deserializing) : base(deserializing) { }
    4753    protected Log(Log original, Cloner cloner)
    4854      : base(original, cloner) {
    49       messages = new List<string>(original.messages);
     55      this.messages = new List<string>(original.messages);
     56      this.maxMessageCount = original.maxMessageCount;
    5057    }
    51     public Log()
     58    public Log(long maxMessageCount = -1)
    5259      : base() {
    53       messages = new List<string>();
     60      this.messages = new List<string>();
     61      this.maxMessageCount = maxMessageCount;
    5462    }
    5563
     
    6573      string s = DateTime.Now.ToString() + "\t" + message;
    6674      messages.Add(s);
     75      CapMessages();
    6776      OnMessageAdded(s);
    6877    }
     
    7079      string s = DateTime.Now.ToString() + "\t" + "Exception occurred:" + Environment.NewLine + ErrorHandling.BuildErrorMessage(ex);
    7180      messages.Add(s);
     81      CapMessages();
    7282      OnMessageAdded(s);
     83    }
     84    protected virtual void CapMessages() {
     85      while (maxMessageCount >= 0 && messages.Count > maxMessageCount) {
     86        messages.RemoveAt(0);
     87      }
    7388    }
    7489
  • branches/GP.Grammar.Editor/HeuristicLab.Core/3.3/Properties/AssemblyInfo.frame

    r6099 r6618  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.4.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.5.$WCREV$")]
Note: See TracChangeset for help on using the changeset viewer.