Changeset 4441


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

Worked on OKB data model and services (#1174)

Location:
branches/OKB/HeuristicLab.Clients.OKB-3.3
Files:
5 added
12 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Administrator.cs

    r4433 r4441  
    3939    }
    4040
     41    private ItemCollection<Platform> platforms;
     42    public ItemCollection<Platform> Platforms {
     43      get { return platforms; }
     44    }
    4145    private ItemCollection<AlgorithmClass> algorithmClasses;
    4246    public ItemCollection<AlgorithmClass> AlgorithmClasses {
     
    5256    public void Refresh() {
    5357      OnRefreshing();
     58      if (platforms == null) {
     59        platforms = new ItemCollection<Platform>();
     60        platforms.ItemsRemoved += new CollectionItemsChangedEventHandler<Platform>(platforms_ItemsRemoved);
     61      }
     62      platforms.Clear();
    5463      if (algorithmClasses == null) {
    5564        algorithmClasses = new ItemCollection<AlgorithmClass>();
    5665        algorithmClasses.ItemsRemoved += new CollectionItemsChangedEventHandler<AlgorithmClass>(algorithmClasses_ItemsRemoved);
    5766      }
     67      algorithmClasses.Clear();
    5868      if (algorithms == null) {
    5969        algorithms = new ItemCollection<Algorithm>();
    6070        algorithms.ItemsRemoved += new CollectionItemsChangedEventHandler<Algorithm>(algorithms_ItemsRemoved);
    6171      }
    62       algorithmClasses.Clear();
    6372      algorithms.Clear();
    6473
    65       var action = new Action(delegate() {
    66         algorithmClasses.AddRange(CallAdminService<ItemCollection<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(a => a.Name));
    67         algorithms.AddRange(CallAdminService<ItemCollection<Algorithm>>(s => s.GetAlgorithms()).OrderBy(a => a.Name));
     74      var call = new Func<Exception>(delegate() {
     75        try {
     76          platforms.AddRange(CallAdminService<ItemCollection<Platform>>(s => s.GetPlatforms()).OrderBy(a => a.Name));
     77          algorithmClasses.AddRange(CallAdminService<ItemCollection<AlgorithmClass>>(s => s.GetAlgorithmClasses()).OrderBy(a => a.Name));
     78          algorithms.AddRange(CallAdminService<ItemCollection<Algorithm>>(s => s.GetAlgorithms()).OrderBy(a => a.Name));
     79          return null;
     80        }
     81        catch (Exception ex) {
     82          return ex;
     83        }
    6884      });
    69       action.BeginInvoke(delegate(IAsyncResult result) {
    70         action.EndInvoke(result);
     85      call.BeginInvoke(delegate(IAsyncResult result) {
     86        Exception ex = call.EndInvoke(result);
     87        if (ex != null) ErrorHandling.ShowErrorDialog("Refresh failed.", ex);
    7188        OnRefreshed();
    7289      }, null);
    7390    }
    7491
    75     public void Store(IOKBItem item) {
    76       if (item is AlgorithmClass)
    77         CallAdminService(s => s.StoreAlgorithmClass((AlgorithmClass)item));
    78       else if (item is Algorithm)
    79         CallAdminService(s => s.StoreAlgorithm((Algorithm)item));
     92    public bool Store(IOKBItem item) {
     93      try {
     94        if (item is Platform)
     95          CallAdminService(s => s.StorePlatform((Platform)item));
     96        else if (item is AlgorithmClass)
     97          CallAdminService(s => s.StoreAlgorithmClass((AlgorithmClass)item));
     98        else if (item is Algorithm)
     99          CallAdminService(s => s.StoreAlgorithm((Algorithm)item));
     100        return true;
     101      }
     102      catch (Exception ex) {
     103        ErrorHandling.ShowErrorDialog("Store failed.", ex);
     104        return false;
     105      }
    80106    }
    81107
     
    91117    }
    92118
     119    private void platforms_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Platform> e) {
     120      try {
     121        foreach (Platform p in e.Items)
     122          CallAdminService(s => s.DeletePlatform(p.Id));
     123      }
     124      catch (Exception ex) {
     125        ErrorHandling.ShowErrorDialog("Delete failed.", ex);
     126      }
     127    }
    93128    private void algorithmClasses_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<AlgorithmClass> e) {
    94       foreach (AlgorithmClass a in e.Items)
    95         CallAdminService(s => s.DeleteAlgorithmClass(a.Id));
     129      try {
     130        foreach (AlgorithmClass a in e.Items)
     131          CallAdminService(s => s.DeleteAlgorithmClass(a.Id));
     132      }
     133      catch (Exception ex) {
     134        ErrorHandling.ShowErrorDialog("Delete failed.", ex);
     135      }
    96136    }
    97137    private void algorithms_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Algorithm> e) {
    98       foreach (Algorithm a in e.Items)
    99         CallAdminService(s => s.DeleteAlgorithm(a.Id));
     138      try {
     139        foreach (Algorithm a in e.Items)
     140          CallAdminService(s => s.DeleteAlgorithm(a.Id));
     141      }
     142      catch (Exception ex) {
     143        ErrorHandling.ShowErrorDialog("Delete failed.", ex);
     144      }
    100145    }
    101146
     
    105150      try {
    106151        call(client);
    107       }
    108       catch (Exception ex) {
    109         ErrorHandling.ShowErrorDialog(ex);
    110152      }
    111153      finally {
     
    123165        return call(client);
    124166      }
    125       catch (Exception ex) {
    126         ErrorHandling.ShowErrorDialog(ex);
    127       }
    128167      finally {
    129168        try {
     
    134173        }
    135174      }
    136       return null;
    137175    }
    138176    #endregion
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/HeuristicLab.Clients.OKB-3.3.csproj

    r4433 r4441  
    8383      <SubType>Code</SubType>
    8484    </Compile>
     85    <Compile Include="ServiceClients\Platform.cs" />
    8586    <Compile Include="ServiceClients\INamedOKBItem.cs">
    8687      <SubType>Code</SubType>
     
    110111    <Compile Include="Views\AlgorithmCollectionView.Designer.cs">
    111112      <DependentUpon>AlgorithmCollectionView.cs</DependentUpon>
     113    </Compile>
     114    <Compile Include="Views\AlgorithmView.cs">
     115      <SubType>UserControl</SubType>
     116    </Compile>
     117    <Compile Include="Views\AlgorithmView.Designer.cs">
     118      <DependentUpon>AlgorithmView.cs</DependentUpon>
     119    </Compile>
     120    <Compile Include="Views\PlatformCollectionView.cs">
     121      <SubType>UserControl</SubType>
     122    </Compile>
     123    <Compile Include="Views\PlatformCollectionView.Designer.cs">
     124      <DependentUpon>PlatformCollectionView.cs</DependentUpon>
    112125    </Compile>
    113126    <Compile Include="Views\OKBItemView.cs">
  • 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       
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AdministratorView.Designer.cs

    r4426 r4441  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.components = new System.ComponentModel.Container();
    4748      this.tabControl = new System.Windows.Forms.TabControl();
     49      this.platformsTabPage = new System.Windows.Forms.TabPage();
     50      this.platformCollectionView = new HeuristicLab.Clients.OKB.PlatformCollectionView();
    4851      this.algorithmClassesTabPage = new System.Windows.Forms.TabPage();
    4952      this.algorithmClassCollectionView = new HeuristicLab.Clients.OKB.AlgorithmClassCollectionView();
    50       this.refreshButton = new System.Windows.Forms.Button();
    5153      this.algorithmsTabPage = new System.Windows.Forms.TabPage();
    5254      this.algorithmCollectionView = new HeuristicLab.Clients.OKB.AlgorithmCollectionView();
     55      this.refreshButton = new System.Windows.Forms.Button();
     56      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5357      this.tabControl.SuspendLayout();
     58      this.platformsTabPage.SuspendLayout();
    5459      this.algorithmClassesTabPage.SuspendLayout();
    5560      this.algorithmsTabPage.SuspendLayout();
     
    6166                  | System.Windows.Forms.AnchorStyles.Left)
    6267                  | System.Windows.Forms.AnchorStyles.Right)));
     68      this.tabControl.Controls.Add(this.platformsTabPage);
    6369      this.tabControl.Controls.Add(this.algorithmClassesTabPage);
    6470      this.tabControl.Controls.Add(this.algorithmsTabPage);
     
    6773      this.tabControl.SelectedIndex = 0;
    6874      this.tabControl.Size = new System.Drawing.Size(727, 406);
    69       this.tabControl.TabIndex = 2;
     75      this.tabControl.TabIndex = 1;
     76      //
     77      // platformsTabPage
     78      //
     79      this.platformsTabPage.Controls.Add(this.platformCollectionView);
     80      this.platformsTabPage.Location = new System.Drawing.Point(4, 22);
     81      this.platformsTabPage.Name = "platformsTabPage";
     82      this.platformsTabPage.Padding = new System.Windows.Forms.Padding(3);
     83      this.platformsTabPage.Size = new System.Drawing.Size(719, 380);
     84      this.platformsTabPage.TabIndex = 2;
     85      this.platformsTabPage.Text = "Platforms";
     86      this.platformsTabPage.UseVisualStyleBackColor = true;
     87      //
     88      // platformCollectionView
     89      //
     90      this.platformCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     91                  | System.Windows.Forms.AnchorStyles.Left)
     92                  | System.Windows.Forms.AnchorStyles.Right)));
     93      this.platformCollectionView.Caption = "PlatformCollection View";
     94      this.platformCollectionView.Content = null;
     95      this.platformCollectionView.Location = new System.Drawing.Point(6, 6);
     96      this.platformCollectionView.Name = "platformCollectionView";
     97      this.platformCollectionView.ReadOnly = false;
     98      this.platformCollectionView.Size = new System.Drawing.Size(707, 368);
     99      this.platformCollectionView.TabIndex = 0;
    70100      //
    71101      // algorithmClassesTabPage
     
    91121      this.algorithmClassCollectionView.ReadOnly = false;
    92122      this.algorithmClassCollectionView.Size = new System.Drawing.Size(707, 368);
    93       this.algorithmClassCollectionView.TabIndex = 3;
    94       //
    95       // refreshButton
    96       //
    97       this.refreshButton.Location = new System.Drawing.Point(0, 0);
    98       this.refreshButton.Name = "refreshButton";
    99       this.refreshButton.Size = new System.Drawing.Size(75, 23);
    100       this.refreshButton.TabIndex = 2;
    101       this.refreshButton.Text = "&Refresh";
    102       this.refreshButton.UseVisualStyleBackColor = true;
    103       this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
     123      this.algorithmClassCollectionView.TabIndex = 0;
    104124      //
    105125      // algorithmsTabPage
     
    125145      this.algorithmCollectionView.ReadOnly = false;
    126146      this.algorithmCollectionView.Size = new System.Drawing.Size(707, 368);
    127       this.algorithmCollectionView.TabIndex = 2;
     147      this.algorithmCollectionView.TabIndex = 0;
     148      //
     149      // refreshButton
     150      //
     151      this.refreshButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Refresh;
     152      this.refreshButton.Location = new System.Drawing.Point(0, 0);
     153      this.refreshButton.Name = "refreshButton";
     154      this.refreshButton.Size = new System.Drawing.Size(24, 24);
     155      this.refreshButton.TabIndex = 0;
     156      this.toolTip.SetToolTip(this.refreshButton, "Refresh Data");
     157      this.refreshButton.UseVisualStyleBackColor = true;
     158      this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click);
    128159      //
    129160      // AdministratorView
     
    136167      this.Size = new System.Drawing.Size(727, 435);
    137168      this.tabControl.ResumeLayout(false);
     169      this.platformsTabPage.ResumeLayout(false);
    138170      this.algorithmClassesTabPage.ResumeLayout(false);
    139171      this.algorithmsTabPage.ResumeLayout(false);
     
    150182    private AlgorithmClassCollectionView algorithmClassCollectionView;
    151183    private AlgorithmCollectionView algorithmCollectionView;
     184    private System.Windows.Forms.ToolTip toolTip;
     185    private System.Windows.Forms.TabPage platformsTabPage;
     186    private PlatformCollectionView platformCollectionView;
    152187
    153188  }
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AdministratorView.cs

    r4433 r4441  
    5353      base.OnContentChanged();
    5454      if (Content == null) {
     55        platformCollectionView.Content = null;
    5556        algorithmClassCollectionView.Content = null;
    5657        algorithmCollectionView.Content = null;
    5758      } else {
     59        platformCollectionView.Content = Content.Platforms;
    5860        algorithmClassCollectionView.Content = Content.AlgorithmClasses;
    5961        algorithmCollectionView.Content = Content.Algorithms;
     
    6466      base.SetEnabledStateOfControls();
    6567      refreshButton.Enabled = Content != null;
     68      platformCollectionView.Enabled = Content != null;
    6669      algorithmClassCollectionView.Enabled = Content != null;
    6770      algorithmCollectionView.Enabled = Content != null;
     
    7275        Invoke(new EventHandler(Content_Refreshing), sender, e);
    7376      } else {
    74         Enabled = false;
    7577        Cursor = Cursors.AppStarting;
     78        refreshButton.Enabled = false;
     79        tabControl.Enabled = false;
    7680      }
    7781    }
     
    8084        Invoke(new EventHandler(Content_Refreshed), sender, e);
    8185      } else {
     86        platformCollectionView.Content = Content.Platforms;
    8287        algorithmClassCollectionView.Content = Content.AlgorithmClasses;
    8388        algorithmCollectionView.Content = Content.Algorithms;
     89        refreshButton.Enabled = true;
     90        tabControl.Enabled = true;
    8491        Cursor = Cursors.Default;
    85         Enabled = true;
    8692      }
    8793    }
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/NamedOKBItemView.Designer.cs

    r4426 r4441  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.components = new System.ComponentModel.Container();
    4847      this.nameLabel = new System.Windows.Forms.Label();
    4948      this.nameTextBox = new System.Windows.Forms.TextBox();
    5049      this.descriptionLabel = new System.Windows.Forms.Label();
    5150      this.descriptionTextBox = new System.Windows.Forms.TextBox();
    52       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     51      ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).BeginInit();
    5352      this.SuspendLayout();
     53      //
     54      // storeButton
     55      //
     56      this.toolTip.SetToolTip(this.storeButton, "Store Data");
     57      //
     58      // modifiedPictureBox
     59      //
     60      this.modifiedPictureBox.Location = new System.Drawing.Point(308, 3);
     61      this.modifiedPictureBox.Size = new System.Drawing.Size(39, 130);
    5462      //
    5563      // nameLabel
     
    6876      this.nameTextBox.Location = new System.Drawing.Point(72, 29);
    6977      this.nameTextBox.Name = "nameTextBox";
    70       this.nameTextBox.Size = new System.Drawing.Size(279, 20);
     78      this.nameTextBox.Size = new System.Drawing.Size(230, 20);
    7179      this.nameTextBox.TabIndex = 2;
     80      this.nameTextBox.TextChanged += new System.EventHandler(this.nameTextBox_TextChanged);
    7281      this.nameTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.nameTextBox_KeyDown);
    73       this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated);
    7482      //
    7583      // descriptionLabel
     
    8997      this.descriptionTextBox.Name = "descriptionTextBox";
    9098      this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    91       this.descriptionTextBox.Size = new System.Drawing.Size(279, 20);
     99      this.descriptionTextBox.Size = new System.Drawing.Size(230, 20);
    92100      this.descriptionTextBox.TabIndex = 4;
     101      this.descriptionTextBox.TextChanged += new System.EventHandler(this.descriptionTextBox_TextChanged);
    93102      this.descriptionTextBox.DoubleClick += new System.EventHandler(this.descriptionTextBox_DoubleClick);
    94       this.descriptionTextBox.Validated += new System.EventHandler(this.descriptionTextBox_Validated);
    95103      //
    96104      // NamedOKBItemView
     
    103111      this.Controls.Add(this.nameTextBox);
    104112      this.Name = "NamedOKBItemView";
    105       this.Size = new System.Drawing.Size(351, 80);
     113      this.Size = new System.Drawing.Size(350, 229);
     114      this.Controls.SetChildIndex(this.modifiedPictureBox, 0);
    106115      this.Controls.SetChildIndex(this.storeButton, 0);
    107116      this.Controls.SetChildIndex(this.nameTextBox, 0);
     
    109118      this.Controls.SetChildIndex(this.descriptionLabel, 0);
    110119      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
     120      ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).EndInit();
    111121      this.ResumeLayout(false);
    112122      this.PerformLayout();
     
    120130    protected System.Windows.Forms.Label descriptionLabel;
    121131    protected System.Windows.Forms.TextBox descriptionTextBox;
    122     protected System.Windows.Forms.ToolTip toolTip;
    123132  }
    124133}
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/NamedOKBItemView.cs

    r4426 r4441  
    9191      }
    9292    }
    93     protected virtual void nameTextBox_Validated(object sender, EventArgs e) {
    94       Content.Name = nameTextBox.Text;
     93    protected virtual void nameTextBox_TextChanged(object sender, EventArgs e) {
     94      if (nameTextBox.Text != Content.Name)
     95        Content.Name = nameTextBox.Text;
    9596    }
    96     protected virtual void descriptionTextBox_Validated(object sender, EventArgs e) {
    97       Content.Description = descriptionTextBox.Text;
     97    protected virtual void descriptionTextBox_TextChanged(object sender, EventArgs e) {
     98      if (descriptionTextBox.Text != Content.Description)
     99        Content.Description = descriptionTextBox.Text;
    98100    }
    99101
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/OKBItemView.Designer.cs

    r4426 r4441  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.components = new System.ComponentModel.Container();
    4748      this.storeButton = new System.Windows.Forms.Button();
     49      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     50      this.modifiedPictureBox = new System.Windows.Forms.PictureBox();
     51      ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).BeginInit();
    4852      this.SuspendLayout();
    4953      //
    5054      // storeButton
    5155      //
     56      this.storeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.PublishToWeb;
    5257      this.storeButton.Location = new System.Drawing.Point(0, 0);
    5358      this.storeButton.Name = "storeButton";
    54       this.storeButton.Size = new System.Drawing.Size(75, 23);
     59      this.storeButton.Size = new System.Drawing.Size(24, 24);
    5560      this.storeButton.TabIndex = 0;
    56       this.storeButton.Text = "&Store";
     61      this.toolTip.SetToolTip(this.storeButton, "Store Data");
    5762      this.storeButton.UseVisualStyleBackColor = true;
    5863      this.storeButton.Click += new System.EventHandler(this.storeButton_Click);
     64      //
     65      // modifiedPictureBox
     66      //
     67      this.modifiedPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     68      this.modifiedPictureBox.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.HighPriorityLarge;
     69      this.modifiedPictureBox.Location = new System.Drawing.Point(312, 3);
     70      this.modifiedPictureBox.Name = "modifiedPictureBox";
     71      this.modifiedPictureBox.Size = new System.Drawing.Size(39, 130);
     72      this.modifiedPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
     73      this.modifiedPictureBox.TabIndex = 1;
     74      this.modifiedPictureBox.TabStop = false;
     75      this.toolTip.SetToolTip(this.modifiedPictureBox, "Data Modified");
     76      this.modifiedPictureBox.Visible = false;
    5977      //
    6078      // OKBItemView
     
    6280      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    6381      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     82      this.Controls.Add(this.modifiedPictureBox);
    6483      this.Controls.Add(this.storeButton);
    6584      this.Name = "OKBItemView";
    66       this.Size = new System.Drawing.Size(315, 292);
     85      this.Size = new System.Drawing.Size(354, 308);
     86      ((System.ComponentModel.ISupportInitialize)(this.modifiedPictureBox)).EndInit();
    6787      this.ResumeLayout(false);
    6888
     
    7292
    7393    protected System.Windows.Forms.Button storeButton;
     94    protected System.Windows.Forms.ToolTip toolTip;
     95    protected System.Windows.Forms.PictureBox modifiedPictureBox;
    7496
    7597
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/OKBItemView.cs

    r4426 r4441  
    4343    protected override void DeregisterContentEvents() {
    4444      Content.PropertyChanged -= new PropertyChangedEventHandler(Content_PropertyChanged);
     45      Content.ModifiedChanged -= new EventHandler(Content_ModifiedChanged);
    4546      base.DeregisterContentEvents();
    4647    }
     
    4849      base.RegisterContentEvents();
    4950      Content.PropertyChanged += new PropertyChangedEventHandler(Content_PropertyChanged);
     51      Content.ModifiedChanged += new EventHandler(Content_ModifiedChanged);
    5052    }
    5153
    5254    protected override void SetEnabledStateOfControls() {
    5355      base.SetEnabledStateOfControls();
    54       storeButton.Enabled = Content != null;
     56      storeButton.Enabled = (Content != null) && Content.Modified;
     57      modifiedPictureBox.Visible = (Content != null) && Content.Modified;
    5558    }
    5659
     
    6366    }
    6467    protected virtual void OnContentPropertyChanged(string propertyName) { }
     68    protected virtual void Content_ModifiedChanged(object sender, EventArgs e) {
     69      if (InvokeRequired)
     70        Invoke(new EventHandler(Content_ModifiedChanged), sender, e);
     71      else {
     72        storeButton.Enabled = Content.Modified;
     73        modifiedPictureBox.Visible = Content.Modified;
     74      }
     75    }
    6576
    6677    protected virtual void storeButton_Click(object sender, EventArgs e) {
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/app.config

    r4422 r4441  
    77                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    88                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    9                     maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
     9                    maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
    1010                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    1111                    allowCookies="false">
Note: See TracChangeset for help on using the changeset viewer.