Changeset 17444 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
- Timestamp:
- 02/18/20 16:28:53 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17439 r17444 9 9 10 10 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 11 public class JsonItemVMBase : INotifyPropertyChanged {11 public class JsonItemVMBase : INotifyPropertyChanged, IDisposable { 12 12 public event PropertyChangedEventHandler PropertyChanged; 13 13 public event Action ItemChanged; … … 17 17 get => item; 18 18 set { 19 item?.LoosenPath(); 19 20 item = value; 21 item.FixatePath(); 20 22 ItemChanged?.Invoke(); 21 23 } … … 80 82 } 81 83 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 82 103 } 83 104 }
Note: See TracChangeset
for help on using the changeset viewer.