Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/20/10 05:15:15 (14 years ago)
Author:
swagner
Message:

Worked on OKB data model and services (#1174)

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  
    2020#endregion
    2121
     22using System;
    2223using System.ComponentModel;
    2324using HeuristicLab.Core;
     
    2526namespace HeuristicLab.Clients.OKB {
    2627  public interface IOKBItem : IItem, INotifyPropertyChanged {
     28    bool Modified { get; }
     29
    2730    void Store();
     31
     32    event EventHandler ModifiedChanged;
    2833  }
    2934}
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/OKBItem.cs

    r4433 r4441  
    4141    }
    4242    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      }
    4449    }
    4550
    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    }
    4773
    4874    public object Clone() {
     
    6086
    6187    public void Store() {
    62       Administrator.Instance.Store(this);
     88      if (Administrator.Instance.Store(this))
     89        Modified = false;
    6390    }
    6491
     
    6693    protected void RaisePropertyChanged(string propertyName) {
    6794      OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
     95      if ((propertyName != "Modified") && (propertyName != "ItemImage")) {
     96        Modified = true;
     97      }
    6898    }
    6999    protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) {
    70100      PropertyChangedEventHandler handler = PropertyChanged;
    71101      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);
    72107    }
    73108    public event EventHandler ItemImageChanged;
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/ServiceClients/ServiceClients.cs

    r4433 r4441  
    99//------------------------------------------------------------------------------
    1010
    11 namespace HeuristicLab.Clients.OKB
    12 {
    13     using System.Runtime.Serialization;
    14    
    15    
    16     [System.Diagnostics.DebuggerStepThroughAttribute()]
     11namespace HeuristicLab.Clients.OKB {
     12
     13
     14  [System.Diagnostics.DebuggerStepThroughAttribute()]
    1715    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    1816    [System.Runtime.Serialization.DataContractAttribute(Name="AlgorithmClass", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.OKB.DataAccess", IsReference=true)]
     
    56925690        void DeleteAlgorithmClass(long algorithmClassId);
    56935691       
     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       
    56945704        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetAlgorithm", ReplyAction="http://tempuri.org/IAdminService/GetAlgorithmResponse")]
    56955705        HeuristicLab.Clients.OKB.Algorithm GetAlgorithm(long algorithmId);
     
    57035713        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/DeleteAlgorithm", ReplyAction="http://tempuri.org/IAdminService/DeleteAlgorithmResponse")]
    57045714        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();
    57085715       
    57095716        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAdminService/GetCompleteAlgorithm", ReplyAction="http://tempuri.org/IAdminService/GetCompleteAlgorithmResponse")]
     
    57745781        }
    57755782       
     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       
    57765803        public HeuristicLab.Clients.OKB.Algorithm GetAlgorithm(long algorithmId)
    57775804        {
     
    57925819        {
    57935820            base.Channel.DeleteAlgorithm(algorithmId);
    5794         }
    5795        
    5796         public HeuristicLab.Core.ItemCollection<HeuristicLab.Clients.OKB.Platform> GetPlatforms()
    5797         {
    5798             return base.Channel.GetPlatforms();
    57995821        }
    58005822       
Note: See TracChangeset for help on using the changeset viewer.