Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/04/10 15:13:28 (14 years ago)
Author:
cneumuel
Message:

worked on "request snapshot" feature (#1115)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/JobItemView.cs

    r4144 r4145  
    4747      Content.LatestSnapshotChanged += new EventHandler(Content_LatestSnapshotChanged);
    4848      Content.JobDtoChanged += new EventHandler(Content_JobDtoChanged);
     49      Content.SnapshotRequestedStateChanged += new EventHandler(Content_SnapshotRequestedStateChanged);
    4950    }
    5051
     
    5253      Content.LatestSnapshotChanged -= new EventHandler(Content_LatestSnapshotChanged);
    5354      Content.JobDtoChanged -= new EventHandler(Content_JobDtoChanged);
     55      Content.SnapshotRequestedStateChanged -= new EventHandler(Content_SnapshotRequestedStateChanged);
    5456      base.DeregisterContentEvents();
    5557    }
     
    9294    protected override void SetEnabledStateOfControls() {
    9395      base.SetEnabledStateOfControls();
    94       openSnapshotButton.Enabled = Content != null && Content.LatestSnapshot != null;
     96      if (Content != null) {
     97        openSnapshotButton.Enabled = Content.SnapshotRequestedState == SnapshotRequestedState.Idle;
     98        requestSnapshotButton.Enabled = Content.SnapshotRequestedState == SnapshotRequestedState.Requested;
     99      }
    95100      this.jobIdTextBox.ReadOnly = this.ReadOnly;
    96101      this.stateTextBox.ReadOnly = this.ReadOnly;
     
    115120
    116121    private void requestSnapshotButton_Click(object sender, EventArgs e) {
    117      
     122      this.Content.RequestSnapshot();
     123    }
     124
     125    private void Content_SnapshotRequestedStateChanged(object sender, EventArgs e) {
     126      SetEnabledStateOfControls();
    118127    }
    119128  }
Note: See TracChangeset for help on using the changeset viewer.