Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7376


Ignore:
Timestamp:
01/19/12 17:56:53 (12 years ago)
Author:
ascheibe
Message:

#1174 added the access service user selection control to the algorithm view of the administrator

Location:
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Administration/Views/AlgorithmView.Designer.cs

    r7331 r7376  
    3434    /// </summary>
    3535    private void InitializeComponent() {
     36      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AlgorithmView));
    3637      this.platformLabel = new System.Windows.Forms.Label();
    3738      this.platformComboBox = new System.Windows.Forms.ComboBox();
     
    4041      this.tabControl = new System.Windows.Forms.TabControl();
    4142      this.usersTabPage = new System.Windows.Forms.TabPage();
    42       this.usersListBox = new System.Windows.Forms.CheckedListBox();
    4343      this.storeUsersButton = new System.Windows.Forms.Button();
    44       this.refreshUsersButton = new System.Windows.Forms.Button();
     44      this.refreshableLightweightUserView = new HeuristicLab.Clients.Access.Views.RefreshableLightweightUserView();
    4545      this.dataTabPage = new System.Windows.Forms.TabPage();
    4646      this.noViewAvailableLabel = new System.Windows.Forms.Label();
     
    135135      // usersTabPage
    136136      //
    137       this.usersTabPage.Controls.Add(this.usersListBox);
    138137      this.usersTabPage.Controls.Add(this.storeUsersButton);
    139       this.usersTabPage.Controls.Add(this.refreshUsersButton);
     138      this.usersTabPage.Controls.Add(this.refreshableLightweightUserView);
    140139      this.usersTabPage.Location = new System.Drawing.Point(4, 22);
    141140      this.usersTabPage.Name = "usersTabPage";
     
    146145      this.usersTabPage.UseVisualStyleBackColor = true;
    147146      //
    148       // usersListBox
    149       //
    150       this.usersListBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    151                   | System.Windows.Forms.AnchorStyles.Left)
    152                   | System.Windows.Forms.AnchorStyles.Right)));
    153       this.usersListBox.CheckOnClick = true;
    154       this.usersListBox.FormattingEnabled = true;
    155       this.usersListBox.Location = new System.Drawing.Point(6, 35);
    156       this.usersListBox.Name = "usersListBox";
    157       this.usersListBox.Size = new System.Drawing.Size(613, 139);
    158       this.usersListBox.TabIndex = 2;
    159       this.usersListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.usersListBox_ItemCheck);
    160       //
    161147      // storeUsersButton
    162148      //
    163       this.storeUsersButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
    164       this.storeUsersButton.Location = new System.Drawing.Point(36, 6);
     149      this.storeUsersButton.Image = ((System.Drawing.Image)(resources.GetObject("storeUsersButton.Image")));
     150      this.storeUsersButton.Location = new System.Drawing.Point(37, 9);
    165151      this.storeUsersButton.Name = "storeUsersButton";
    166152      this.storeUsersButton.Size = new System.Drawing.Size(24, 24);
     
    170156      this.storeUsersButton.Click += new System.EventHandler(this.storeUsersButton_Click);
    171157      //
    172       // refreshUsersButton
    173       //
    174       this.refreshUsersButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
    175       this.refreshUsersButton.Location = new System.Drawing.Point(6, 6);
    176       this.refreshUsersButton.Name = "refreshUsersButton";
    177       this.refreshUsersButton.Size = new System.Drawing.Size(24, 24);
    178       this.refreshUsersButton.TabIndex = 0;
    179       this.toolTip.SetToolTip(this.refreshUsersButton, "Refresh Authorized Users");
    180       this.refreshUsersButton.UseVisualStyleBackColor = true;
    181       this.refreshUsersButton.Click += new System.EventHandler(this.refreshUsersButton_Click);
     158      // refreshableLightweightUserView
     159      //
     160      this.refreshableLightweightUserView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     161                  | System.Windows.Forms.AnchorStyles.Left)
     162                  | System.Windows.Forms.AnchorStyles.Right)));
     163      this.refreshableLightweightUserView.BackColor = System.Drawing.Color.Transparent;
     164      this.refreshableLightweightUserView.Caption = "RefreshableLightweightUser View";
     165      this.refreshableLightweightUserView.Content = null;
     166      this.refreshableLightweightUserView.FetchSelectedUsers = null;
     167      this.refreshableLightweightUserView.Location = new System.Drawing.Point(6, 6);
     168      this.refreshableLightweightUserView.Name = "refreshableLightweightUserView";
     169      this.refreshableLightweightUserView.ReadOnly = false;
     170      this.refreshableLightweightUserView.Size = new System.Drawing.Size(613, 168);
     171      this.refreshableLightweightUserView.TabIndex = 3;
     172      this.refreshableLightweightUserView.SelectedUsersChanged += new System.EventHandler(this.refreshableLightweightUserView_SelectedUsersChanged);
    182173      //
    183174      // dataTabPage
     
    226217      // saveFileButton
    227218      //
    228       this.saveFileButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Save;
     219      this.saveFileButton.Image = ((System.Drawing.Image)(resources.GetObject("saveFileButton.Image")));
    229220      this.saveFileButton.Location = new System.Drawing.Point(126, 6);
    230221      this.saveFileButton.Name = "saveFileButton";
     
    237228      // openFileButton
    238229      //
    239       this.openFileButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
     230      this.openFileButton.Image = ((System.Drawing.Image)(resources.GetObject("openFileButton.Image")));
    240231      this.openFileButton.Location = new System.Drawing.Point(96, 6);
    241232      this.openFileButton.Name = "openFileButton";
     
    248239      // newDataButton
    249240      //
    250       this.newDataButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
     241      this.newDataButton.Image = ((System.Drawing.Image)(resources.GetObject("newDataButton.Image")));
    251242      this.newDataButton.Location = new System.Drawing.Point(66, 6);
    252243      this.newDataButton.Name = "newDataButton";
     
    259250      // storeDataButton
    260251      //
    261       this.storeDataButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
     252      this.storeDataButton.Image = ((System.Drawing.Image)(resources.GetObject("storeDataButton.Image")));
    262253      this.storeDataButton.Location = new System.Drawing.Point(36, 6);
    263254      this.storeDataButton.Name = "storeDataButton";
     
    270261      // refreshDataButton
    271262      //
    272       this.refreshDataButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
     263      this.refreshDataButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshDataButton.Image")));
    273264      this.refreshDataButton.Location = new System.Drawing.Point(6, 6);
    274265      this.refreshDataButton.Name = "refreshDataButton";
     
    388379    private System.Windows.Forms.TabPage usersTabPage;
    389380    private System.Windows.Forms.Button storeUsersButton;
    390     private System.Windows.Forms.Button refreshUsersButton;
    391381    private System.Windows.Forms.TabPage dataTabPage;
    392     private System.Windows.Forms.CheckedListBox usersListBox;
    393382    private System.Windows.Forms.Label dataTypeNameLabel;
    394383    private System.Windows.Forms.GroupBox dataTypeGroupBox;
     
    405394    private MainForm.WindowsForms.ViewHost dataViewHost;
    406395    private System.Windows.Forms.Label noViewAvailableLabel;
     396    private Access.Views.RefreshableLightweightUserView refreshableLightweightUserView;
    407397
    408398  }
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Administration/Views/AlgorithmView.cs

    r7331 r7376  
    2525using System.Linq;
    2626using System.Windows.Forms;
    27 using HeuristicLab.Clients.OKB.Authentication;
    2827using HeuristicLab.Common;
    2928using HeuristicLab.Core.Views;
     
    7372      algorithmClassComboBox.SelectedValueChanged += new EventHandler(algorithmClassComboBox_SelectedValueChanged);
    7473
    75       usersListBox.DataSource = null;
    7674      data = null;
    7775      dataViewHost.Content = null;
     
    8179        dataTypeNameTextBox.Text = string.Empty;
    8280        dataTypeTypeNameTextBox.Text = string.Empty;
     81        refreshableLightweightUserView.Content = null;
     82        refreshableLightweightUserView.FetchSelectedUsers = null;
    8383      } else {
    8484        platformComboBox.SelectedItem = platformComboBoxValues.FirstOrDefault(p => p.Id == Content.PlatformId);
     
    8686        dataTypeNameTextBox.Text = Content.DataTypeName;
    8787        dataTypeTypeNameTextBox.Text = Content.DataTypeTypeName;
     88        refreshableLightweightUserView.Content = Access.AccessClient.Instance;
     89        refreshableLightweightUserView.FetchSelectedUsers = new Func<List<Guid>>(delegate { return AdministrationClient.GetAlgorithmUsers(Content.Id); });
    8890      }
    8991    }
     
    9496      algorithmClassComboBox.Enabled = (Content != null) && !ReadOnly;
    9597      dataTypeGroupBox.Enabled = (Content != null) && !ReadOnly;
    96       refreshUsersButton.Enabled = (Content != null) && (Content.Id != 0);
    97       storeUsersButton.Enabled = (usersListBox.DataSource != null) && !ReadOnly;
    98       usersListBox.Enabled = (usersListBox.DataSource != null) && !ReadOnly;
     98      storeUsersButton.Enabled = (refreshableLightweightUserView.GetCheckedUsers() != null) && !ReadOnly;
     99      refreshableLightweightUserView.Enabled = (refreshableLightweightUserView.Content != null) && !ReadOnly;
    99100      refreshDataButton.Enabled = (Content != null) && (Content.Id != 0);
    100101      storeDataButton.Enabled = ((data != null) || (dataViewHost.Content != null)) && !ReadOnly;
     
    155156    }
    156157
    157     private void refreshUsersButton_Click(object sender, System.EventArgs e) {
    158       try {
    159         List<Guid> ids = AdministrationClient.GetAlgorithmUsers(Content.Id);
    160         if (ids != null) {
    161           if (AuthenticationClient.Instance.Users == null) AuthenticationClient.Instance.Refresh();
    162           List<User> users = AuthenticationClient.Instance.Users.ToList();
    163           usersListBox.DataSource = users;
    164           usersListBox.DisplayMember = "Name";
    165           for (int i = 0; i < users.Count; i++)
    166             usersListBox.SetItemChecked(i, ids.Contains(users[i].Id));
    167           usersListBox.Enabled = !ReadOnly;
    168           storeUsersButton.Enabled = false;
    169         }
    170       }
    171       catch (Exception ex) {
    172         ErrorHandling.ShowErrorDialog(this, "Refresh authorized users and groups failed.", ex);
    173       }
    174     }
    175158    private void storeUsersButton_Click(object sender, System.EventArgs e) {
    176159      try {
    177         AdministrationClient.UpdateAlgorithmUsers(Content.Id, usersListBox.SelectedItems.Cast<User>().Select(u => u.Id).ToList());
     160        AdministrationClient.UpdateAlgorithmUsers(Content.Id, refreshableLightweightUserView.GetCheckedUsers().CheckedItems.Select(x => x.Value.Id).ToList());
    178161        storeUsersButton.Enabled = false;
    179162      }
     
    181164        ErrorHandling.ShowErrorDialog(this, "Store authorized users and groups failed.", ex);
    182165      }
    183     }
    184     private void usersListBox_ItemCheck(object sender, ItemCheckEventArgs e) {
    185       storeUsersButton.Enabled = !ReadOnly;
    186166    }
    187167
     
    325305    }
    326306    #endregion
     307
     308    private void refreshableLightweightUserView_SelectedUsersChanged(object sender, EventArgs e) {
     309      storeUsersButton.Enabled = !ReadOnly;
     310    }
    327311  }
    328312}
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLab.Clients.OKB-3.3.csproj

    r7349 r7376  
    3939  </PropertyGroup>
    4040  <ItemGroup>
     41    <Reference Include="HeuristicLab.Clients.Access-3.3">
     42      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Clients.Access-3.3.dll</HintPath>
     43      <Private>False</Private>
     44    </Reference>
    4145    <Reference Include="HeuristicLab.Clients.Common-3.3">
    4246      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Clients.Common-3.3.dll</HintPath>
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/Plugin.cs.frame

    r7332 r7376  
    2929  [PluginFile("HeuristicLab.Clients.OKB-3.3.dll", PluginFileType.Assembly)] 
    3030  [PluginDependency("HeuristicLab.Clients.Common", "3.3")]
     31  [PluginDependency("HeuristicLab.Clients.Access", "3.3")]
    3132  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3233  [PluginDependency("HeuristicLab.Common", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.