Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/18/20 16:28:53 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • added two new methods in IJsonItem -> FixatePath and LoosenPath to fixate/loosen the path (to enable name changing without effects on path)
  • set IsInRange to virtual and made overrides for IntMatrixJsonItem and DoubleMatrixJsonItem (IsInRange is a bad name and needs to be renamed in future versions)
  • implemented basic validation feedback with ErrorProvider for some inputs (templateName, Name, Range)
  • now all items gets validated before export (validation errors are shown with ErrorHandling.ShowErrorDialog)
  • added a check in AlgorithmConverter to prevent an exception for accessing the first element of an empty IEnumerable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs

    r17439 r17444  
    99
    1010namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    11   public class JsonItemVMBase : INotifyPropertyChanged {
     11  public class JsonItemVMBase : INotifyPropertyChanged, IDisposable {
    1212    public event PropertyChangedEventHandler PropertyChanged;
    1313    public event Action ItemChanged;
     
    1717      get => item;
    1818      set {
     19        item?.LoosenPath();
    1920        item = value;
     21        item.FixatePath();
    2022        ItemChanged?.Invoke();
    2123      }
     
    8082    }
    8183
     84    #region IDisposable Support
     85    private bool disposedValue = false; // To detect redundant calls
     86
     87    protected virtual void Dispose(bool disposing) {
     88      if (!disposedValue) {
     89        if (disposing) {
     90          item.LoosenPath();
     91          item = null;
     92        }
     93        disposedValue = true;
     94      }
     95    }
     96
     97    // This code added to correctly implement the disposable pattern.
     98    public void Dispose() {
     99      // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
     100      Dispose(true);
     101    }
     102    #endregion
    82103  }
    83104}
Note: See TracChangeset for help on using the changeset viewer.