Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/13/19 13:59:30 (5 years ago)
Author:
mkommend
Message:

#2521: Merged trunk changes up to r16945 into branch.

Location:
branches/2521_ProblemRefactoring
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring

  • branches/2521_ProblemRefactoring/HeuristicLab.Core

  • branches/2521_ProblemRefactoring/HeuristicLab.Core/3.3/Attributes/CreatableAttribute.cs

    r16874 r16946  
    3535      public const string PopulationBasedAlgorithms = Algorithms + SplitToken + "1" + OrderToken + "Population Based";
    3636      public const string SingleSolutionAlgorithms = Algorithms + SplitToken + "2" + OrderToken + "Single Solution";
     37      public const string ExactAlgorithms = Algorithms + SplitToken + "3" + OrderToken + "Exact";
    3738
    3839      public const string Problems = "2" + OrderToken + "Problems";
  • branches/2521_ProblemRefactoring/HeuristicLab.Core/3.3/Interfaces/IValueParameter.cs

    r16723 r16946  
    2727  public interface IValueParameter : IParameter {
    2828    IItem Value { get; set; }
     29    bool ReadOnly { get; set; }
    2930    bool GetsCollected { get; set; }
    3031    event EventHandler ValueChanged;
     32    event EventHandler ReadOnlyChanged;
    3133    event EventHandler GetsCollectedChanged;
    3234  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Core/3.3/NamedItem.cs

    r16723 r16946  
    3030    [Storable]
    3131    protected string name;
    32     /// <inheritdoc/>
     32    /// Gets and sets the name of the item.
    3333    /// <remarks>Calls <see cref="OnNameChanging"/> and also <see cref="OnNameChanged"/>
    3434    /// eventually in the setter.</remarks>
     
    7474    }
    7575    /// <summary>
    76     /// Initializes a new instance of <see cref="Variable"/> with name <c>Anonymous</c>
     76    /// Initializes a new instance of <see cref="NamedItem"/> with name and description <c>string.Empty</c>
    7777    /// and value <c>null</c>.
    7878    /// </summary>
     
    8282    }
    8383    /// <summary>
    84     /// Initializes a new instance of <see cref="Variable"/> with the specified <paramref name="name"/>
    85     /// and the specified <paramref name="value"/>.
     84    /// Initializes a new instance of <see cref="NamedItem"/> with the specified <paramref name="name"/>
    8685    /// </summary>
    8786    /// <param name="name">The name of the current instance.</param>
    88     /// <param name="value">The value of the current instance.</param>
    8987    protected NamedItem(string name) {
    9088      if (name == null) this.name = string.Empty;
     
    9290      description = string.Empty;
    9391    }
     92    /// <summary>
     93    /// Initializes a new instance of <see cref="NamedItem"/> with the specified <paramref name="name"/> and <paramref name="description"/>.
     94    /// </summary>
    9495    protected NamedItem(string name, string description) {
    9596      if (name == null) this.name = string.Empty;
     
    100101
    101102    /// <summary>
    102     /// Gets the string representation of the current instance in the format: <c>Name: [null|Value]</c>.
     103    /// Gets the string representation of the current instance.
    103104    /// </summary>
    104105    /// <returns>The current instance as a string.</returns>
     
    122123    /// Fires a new <c>NameChanged</c> event.
    123124    /// </summary>
    124     /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks>
     125    /// <remarks>Calls <see cref="Item.OnToStringChanged"/>.</remarks>
    125126    protected virtual void OnNameChanged() {
    126127      var handler = NameChanged;
     
    133134    /// Fires a new <c>DescriptionChanged</c> event.
    134135    /// </summary>
    135     /// <remarks>Calls <see cref="ItemBase.OnChanged"/>.</remarks>
    136136    protected virtual void OnDescriptionChanged() {
    137137      var handler = DescriptionChanged;
  • branches/2521_ProblemRefactoring/HeuristicLab.Core/3.3/PersistenceContentManager.cs

    r16723 r16946  
    3131
    3232    protected override IStorableContent LoadContent(string filename) {
    33       // first try to load using the new persistence format
    34       try {
    35         var ser = new ProtoBufSerializer();
    36         return (IStorableContent)ser.Deserialize(filename);
    37       } catch (Exception) {
    38         // try old format if new format fails
    39         return XmlParser.Deserialize<IStorableContent>(filename);
    40       }
     33      bool useOldPersistence = XmlParser.CanOpen(filename);
     34      if (useOldPersistence) return XmlParser.Deserialize<IStorableContent>(filename);
     35
     36      var ser = new ProtoBufSerializer();
     37      return (IStorableContent)ser.Deserialize(filename, out SerializationInfo info);
    4138    }
    4239
    4340    protected override void SaveContent(IStorableContent content, string filename, bool compressed, CancellationToken cancellationToken) {
    4441      var ser = new ProtoBufSerializer();
    45       ser.Serialize(content, filename, cancellationToken); 
     42      ser.Serialize(content, filename, cancellationToken);
    4643    }
    4744  }
Note: See TracChangeset for help on using the changeset viewer.