Changeset 4441 for branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients
- Timestamp:
- 09/20/10 05:15:15 (14 years ago)
- Location:
- branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/IOKBItem.cs
r4426 r4441 20 20 #endregion 21 21 22 using System; 22 23 using System.ComponentModel; 23 24 using HeuristicLab.Core; … … 25 26 namespace HeuristicLab.Clients.OKB { 26 27 public interface IOKBItem : IItem, INotifyPropertyChanged { 28 bool Modified { get; } 29 27 30 void Store(); 31 32 event EventHandler ModifiedChanged; 28 33 } 29 34 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/OKBItem.cs
r4433 r4441 41 41 } 42 42 public virtual Image ItemImage { 43 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Class; } 43 get { 44 if (Modified) 45 return HeuristicLab.Common.Resources.VS2008ImageLibrary.DatabaseModified; 46 else 47 return HeuristicLab.Common.Resources.VS2008ImageLibrary.Database; 48 } 44 49 } 45 50 46 protected OKBItem() { } 51 private bool modified; 52 public bool Modified { 53 get { return modified; } 54 private set { 55 if (value != modified) { 56 modified = value; 57 OnModifiedChanged(); 58 RaisePropertyChanged("Modified"); 59 OnItemImageChanged(); 60 RaisePropertyChanged("ItemImage"); 61 } 62 } 63 } 64 65 protected OKBItem() { 66 modified = true; 67 } 68 69 [OnDeserialized] 70 private void OnDeserialized(StreamingContext context) { 71 modified = false; 72 } 47 73 48 74 public object Clone() { … … 60 86 61 87 public void Store() { 62 Administrator.Instance.Store(this); 88 if (Administrator.Instance.Store(this)) 89 Modified = false; 63 90 } 64 91 … … 66 93 protected void RaisePropertyChanged(string propertyName) { 67 94 OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); 95 if ((propertyName != "Modified") && (propertyName != "ItemImage")) { 96 Modified = true; 97 } 68 98 } 69 99 protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) { 70 100 PropertyChangedEventHandler handler = PropertyChanged; 71 101 if (handler != null) handler(this, e); 102 } 103 public event EventHandler ModifiedChanged; 104 protected virtual void OnModifiedChanged() { 105 EventHandler handler = ModifiedChanged; 106 if (handler != null) handler(this, EventArgs.Empty); 72 107 } 73 108 public event EventHandler ItemImageChanged; -
branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/ServiceClients.cs
r4433 r4441 9 9 //------------------------------------------------------------------------------ 10 10 11 namespace HeuristicLab.Clients.OKB 12 { 13 using System.Runtime.Serialization; 14 15 16 [System.Diagnostics.DebuggerStepThroughAttribute()] 11 namespace HeuristicLab.Clients.OKB { 12 13 14 [System.Diagnostics.DebuggerStepThroughAttribute()] 17 15 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 18 16 [System.Runtime.Serialization.DataContractAttribute(Name="AlgorithmClass", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.DataAccess", IsReference=true)] … … 5692 5690 void DeleteAlgorithmClass(long algorithmClassId); 5693 5691 5692 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetPlatform", ReplyAction="http://tempuri.org/IAdminService/GetPlatformResponse")] 5693 HeuristicLab.Clients.OKB.Platform GetPlatform(long platformId); 5694 5695 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetPlatforms", ReplyAction="http://tempuri.org/IAdminService/GetPlatformsResponse")] 5696 HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms(); 5697 5698 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/StorePlatform", ReplyAction="http://tempuri.org/IAdminService/StorePlatformResponse")] 5699 void StorePlatform(HeuristicLab.Clients.OKB.Platform platform); 5700 5701 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/DeletePlatform", ReplyAction="http://tempuri.org/IAdminService/DeletePlatformResponse")] 5702 void DeletePlatform(long platformId); 5703 5694 5704 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetAlgorithm", ReplyAction="http://tempuri.org/IAdminService/GetAlgorithmResponse")] 5695 5705 HeuristicLab.Clients.OKB.Algorithm GetAlgorithm(long algorithmId); … … 5703 5713 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/DeleteAlgorithm", ReplyAction="http://tempuri.org/IAdminService/DeleteAlgorithmResponse")] 5704 5714 void DeleteAlgorithm(long algorithmId); 5705 5706 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetPlatforms", ReplyAction="http://tempuri.org/IAdminService/GetPlatformsResponse")]5707 HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms();5708 5715 5709 5716 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetCompleteAlgorithm", ReplyAction="http://tempuri.org/IAdminService/GetCompleteAlgorithmResponse")] … … 5774 5781 } 5775 5782 5783 public HeuristicLab.Clients.OKB.Platform GetPlatform(long platformId) 5784 { 5785 return base.Channel.GetPlatform(platformId); 5786 } 5787 5788 public HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms() 5789 { 5790 return base.Channel.GetPlatforms(); 5791 } 5792 5793 public void StorePlatform(HeuristicLab.Clients.OKB.Platform platform) 5794 { 5795 base.Channel.StorePlatform(platform); 5796 } 5797 5798 public void DeletePlatform(long platformId) 5799 { 5800 base.Channel.DeletePlatform(platformId); 5801 } 5802 5776 5803 public HeuristicLab.Clients.OKB.Algorithm GetAlgorithm(long algorithmId) 5777 5804 { … … 5792 5819 { 5793 5820 base.Channel.DeleteAlgorithm(algorithmId); 5794 }5795 5796 public HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms()5797 {5798 return base.Channel.GetPlatforms();5799 5821 } 5800 5822
Note: See TracChangeset
for help on using the changeset viewer.