Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/22/12 11:11:38 (12 years ago)
Author:
jkarder
Message:

#1331:

  • synced branch with trunk
  • added custom interface (ISimilarityBasedOperator) to mark operators that conduct similarity calculation
  • similarity calculators are now parameterized by the algorithm
  • deleted SolutionPool2TierUpdateMethod
  • deleted KnapsackMultipleGuidesPathRelinker
  • moved IImprovementOperator, IPathRelinker and ISimilarityCalculator to HeuristicLab.Optimization
  • added parameter descriptions
  • fixed plugin references
  • fixed count of EvaluatedSolutions
  • fixed check for duplicate solutions
  • minor code improvements
Location:
branches/ScatterSearch (trunk integration)
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)

  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3

    • Property svn:ignore
      •  

        old new  
        22obj
        33*.vs10x
         4*.user
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/HeuristicLab.Clients.Hive.Administrator-3.3.csproj

    r7257 r8086  
    9797  </ItemGroup>
    9898  <ItemGroup>
     99    <Compile Include="HiveRoles.cs" />
    99100    <Compile Include="Views\HiveAdministratorView.cs">
    100101      <SubType>UserControl</SubType>
     
    141142  </ItemGroup>
    142143  <ItemGroup>
     144    <ProjectReference Include="..\..\HeuristicLab.Clients.Access.Views\3.3\HeuristicLab.Clients.Access.Views-3.3.csproj">
     145      <Project>{FE856595-64CD-46DA-9CD2-FFF3E6B0D4F2}</Project>
     146      <Name>HeuristicLab.Clients.Access.Views-3.3</Name>
     147    </ProjectReference>
     148    <ProjectReference Include="..\..\HeuristicLab.Clients.Access\3.3\HeuristicLab.Clients.Access-3.3.csproj">
     149      <Project>{494F87F4-0F25-4D33-A382-10CDB2174D48}</Project>
     150      <Name>HeuristicLab.Clients.Access-3.3</Name>
     151    </ProjectReference>
    143152    <ProjectReference Include="..\..\HeuristicLab.Clients.Common\3.3\HeuristicLab.Clients.Common-3.3.csproj">
    144153      <Project>{730A9104-D4D1-4360-966B-E49B7571DDA3}</Project>
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/HiveRoles.cs

    r8052 r8086  
    3131
    3232    public static bool CheckAdminUserPermissions() {
    33       UserInformation.Instance.Refresh();
    3433      return UserInformation.Instance.UserExists && UserInformation.Instance.User.Roles.Any(x => x.Name == HiveRoles.Administrator);
    3534    }
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Plugin.cs.frame

    r7259 r8086  
    2525  [Plugin("HeuristicLab.Clients.Hive.Administrator", "3.3.6.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Clients.Hive.Administrator-3.3.dll", PluginFileType.Assembly)]
     27  [PluginDependency("HeuristicLab.Clients.Access", "3.3")] 
     28  [PluginDependency("HeuristicLab.Clients.Access.Views", "3.3")]
    2729  [PluginDependency("HeuristicLab.Collections", "3.3")]
    2830  [PluginDependency("HeuristicLab.Common", "3.3")]
     
    3234  [PluginDependency("HeuristicLab.Clients.Hive", "3.3")]
    3335  [PluginDependency("HeuristicLab.Clients.Hive.Views", "3.3")]
     36  [PluginDependency("HeuristicLab.DayView", "1.0.0.0")]
    3437  [PluginDependency("HeuristicLab.Optimizer", "3.3")]
    3538  [PluginDependency("HeuristicLab.MainForm", "3.3")]
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/HiveAdministratorView.Designer.cs

    r7259 r8086  
    8181      //
    8282      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    83       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     83      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    8484      this.Controls.Add(this.tabAdmin);
    8585      this.Name = "HiveAdministrationView";
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.Designer.cs

    r7257 r8086  
    235235      //
    236236      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    237       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     237      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    238238      this.ClientSize = new System.Drawing.Size(393, 243);
    239239      this.Controls.Add(this.gbWeekly);
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.Designer.cs

    r7259 r8086  
    2121
    2222
     23using System;
    2324namespace HeuristicLab.Clients.Hive.Administrator.Views {
    2425  partial class ResourcesView {
     
    3637        components.Dispose();
    3738      }
     39      HiveAdminClient.Instance.Refreshing -= new EventHandler(Instance_Refreshing);
     40      HiveAdminClient.Instance.Refreshed -= new EventHandler(Instance_Refreshed);
     41
     42      Access.AccessClient.Instance.Refreshing -= new EventHandler(AccessClient_Refreshing);
     43      Access.AccessClient.Instance.Refreshed -= new EventHandler(AccessClient_Refreshed);
    3844      base.Dispose(disposing);
    3945    }
     
    5460      this.btnRemoveGroup = new System.Windows.Forms.Button();
    5561      this.btnAddGroup = new System.Windows.Forms.Button();
     62      this.btnPermissionsSave = new System.Windows.Forms.Button();
    5663      this.treeSlaveGroup = new System.Windows.Forms.TreeView();
    5764      this.tabSlaveGroup = new System.Windows.Forms.TabControl();
     
    6168      this.scheduleView = new HeuristicLab.Clients.Hive.Administrator.Views.ScheduleView();
    6269      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     70      this.tabPermissions = new System.Windows.Forms.TabPage();
     71      this.permissionView = new HeuristicLab.Clients.Access.Views.RefreshableLightweightUserView();
    6372      ((System.ComponentModel.ISupportInitialize)(this.splitSlaves)).BeginInit();
    6473      this.splitSlaves.Panel1.SuspendLayout();
     
    6877      this.tabDetails.SuspendLayout();
    6978      this.tabSchedule.SuspendLayout();
     79      this.tabPermissions.SuspendLayout();
    7080      this.SuspendLayout();
    7181      //
     
    7989      //
    8090      this.splitSlaves.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    81                   | System.Windows.Forms.AnchorStyles.Left)
    82                   | System.Windows.Forms.AnchorStyles.Right)));
     91            | System.Windows.Forms.AnchorStyles.Left)
     92            | System.Windows.Forms.AnchorStyles.Right)));
    8393      this.splitSlaves.Location = new System.Drawing.Point(3, 3);
    8494      this.splitSlaves.Name = "splitSlaves";
     
    156166      this.treeSlaveGroup.AllowDrop = true;
    157167      this.treeSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    158                   | System.Windows.Forms.AnchorStyles.Left)
    159                   | System.Windows.Forms.AnchorStyles.Right)));
     168            | System.Windows.Forms.AnchorStyles.Left)
     169            | System.Windows.Forms.AnchorStyles.Right)));
    160170      this.treeSlaveGroup.ImageIndex = 0;
    161171      this.treeSlaveGroup.ImageList = this.imageListSlaveGroups;
     
    166176      this.treeSlaveGroup.TabIndex = 0;
    167177      this.treeSlaveGroup.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeSlaveGroup_ItemDrag);
    168       this.treeSlaveGroup.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeSlaveGroup_NodeMouseClick);
     178      this.treeSlaveGroup.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeSlaveGroup_AfterSelect);
    169179      this.treeSlaveGroup.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragDrop);
    170180      this.treeSlaveGroup.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragEnter);
     
    175185      //
    176186      this.tabSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    177                   | System.Windows.Forms.AnchorStyles.Left)
    178                   | System.Windows.Forms.AnchorStyles.Right)));
     187            | System.Windows.Forms.AnchorStyles.Left)
     188            | System.Windows.Forms.AnchorStyles.Right)));
    179189      this.tabSlaveGroup.Controls.Add(this.tabDetails);
    180190      this.tabSlaveGroup.Controls.Add(this.tabSchedule);
     191      this.tabSlaveGroup.Controls.Add(this.tabPermissions);
    181192      this.tabSlaveGroup.Location = new System.Drawing.Point(3, 3);
    182193      this.tabSlaveGroup.Name = "tabSlaveGroup";
     
    200211      //
    201212      this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    202                   | System.Windows.Forms.AnchorStyles.Left)
    203                   | System.Windows.Forms.AnchorStyles.Right)));
     213            | System.Windows.Forms.AnchorStyles.Left)
     214            | System.Windows.Forms.AnchorStyles.Right)));
    204215      this.slaveView.Caption = "SlaveView";
    205216      this.slaveView.Content = null;
    206       this.slaveView.Location = new System.Drawing.Point(7, 7);
     217      this.slaveView.Location = new System.Drawing.Point(6, 6);
    207218      this.slaveView.Name = "slaveView";
    208219      this.slaveView.ReadOnly = false;
    209       this.slaveView.Size = new System.Drawing.Size(564, 502);
     220      this.slaveView.Size = new System.Drawing.Size(565, 503);
    210221      this.slaveView.TabIndex = 0;
    211222      //
     
    224235      //
    225236      this.scheduleView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    226                   | System.Windows.Forms.AnchorStyles.Left)
    227                   | System.Windows.Forms.AnchorStyles.Right)));
     237            | System.Windows.Forms.AnchorStyles.Left)
     238            | System.Windows.Forms.AnchorStyles.Right)));
    228239      this.scheduleView.Caption = "ScheduleView";
    229240      this.scheduleView.Content = null;
    230       this.scheduleView.Location = new System.Drawing.Point(3, 8);
     241      this.scheduleView.Location = new System.Drawing.Point(6, 6);
    231242      this.scheduleView.Name = "scheduleView";
    232243      this.scheduleView.ReadOnly = false;
    233       this.scheduleView.Size = new System.Drawing.Size(568, 501);
     244      this.scheduleView.Size = new System.Drawing.Size(565, 503);
    234245      this.scheduleView.TabIndex = 0;
    235246      //
     247      // tabPermissions
     248      //
     249      this.tabPermissions.Controls.Add(this.btnPermissionsSave);
     250      this.tabPermissions.Controls.Add(this.permissionView);
     251      this.tabPermissions.Location = new System.Drawing.Point(4, 22);
     252      this.tabPermissions.Name = "tabPermissions";
     253      this.tabPermissions.Padding = new System.Windows.Forms.Padding(3);
     254      this.tabPermissions.Size = new System.Drawing.Size(577, 515);
     255      this.tabPermissions.TabIndex = 2;
     256      this.tabPermissions.Text = "Permissions";
     257      this.tabPermissions.UseVisualStyleBackColor = true;
     258      //
     259      // btnPermissionsSave
     260      //
     261      this.btnPermissionsSave.Enabled = false;
     262      this.btnPermissionsSave.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
     263      this.btnPermissionsSave.Location = new System.Drawing.Point(39, 9);
     264      this.btnPermissionsSave.Name = "btnPermissionsSave";
     265      this.btnPermissionsSave.Size = new System.Drawing.Size(24, 24);
     266      this.btnPermissionsSave.TabIndex = 1;
     267      this.toolTip.SetToolTip(this.btnPermissionsSave, "Store slave and group sharing permissions on the server");
     268      this.btnPermissionsSave.UseVisualStyleBackColor = true;
     269      this.btnPermissionsSave.Click += new System.EventHandler(this.btnPermissionsSave_Click);
     270      //
     271      // permissionView
     272      //
     273      this.permissionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     274            | System.Windows.Forms.AnchorStyles.Left)
     275            | System.Windows.Forms.AnchorStyles.Right)));
     276      this.permissionView.Caption = "RefreshableLightweightUser View";
     277      this.permissionView.Content = null;
     278      this.permissionView.FetchSelectedUsers = null;
     279      this.permissionView.Location = new System.Drawing.Point(6, 6);
     280      this.permissionView.Name = "permissionView";
     281      this.permissionView.ReadOnly = false;
     282      this.permissionView.Size = new System.Drawing.Size(565, 503);
     283      this.permissionView.TabIndex = 0;
     284      //
    236285      // ResourcesView
    237286      //
    238       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    239       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     287      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    240288      this.Controls.Add(this.splitSlaves);
    241289      this.Name = "ResourcesView";
     
    249297      this.tabDetails.ResumeLayout(false);
    250298      this.tabSchedule.ResumeLayout(false);
     299      this.tabPermissions.ResumeLayout(false);
    251300      this.ResumeLayout(false);
    252301
     
    269318    private System.Windows.Forms.Button btnRefresh;
    270319    private System.Windows.Forms.ToolTip toolTip;
     320    private System.Windows.Forms.TabPage tabPermissions;
     321    private Access.Views.RefreshableLightweightUserView permissionView;
     322    private System.Windows.Forms.Button btnPermissionsSave;
    271323  }
    272324}
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs

    r7259 r8086  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Drawing;
    2425using System.Linq;
     
    2728using System.Threading.Tasks;
    2829using System.Windows.Forms;
     30using HeuristicLab.Clients.Access;
    2931using HeuristicLab.Clients.Hive.Views;
    3032using HeuristicLab.Core;
     
    3537namespace HeuristicLab.Clients.Hive.Administrator.Views {
    3638  [View("Resources View")]
    37   [Content(typeof(IItemList<Resource>), IsDefaultView = true)]
     39  [Content(typeof(IItemList<Resource>), false)]
    3840  public partial class ResourcesView : ItemView, IDisposable {
    3941    public new IItemList<Resource> Content {
     
    4547    private const int slaveImageIndex = 0;
    4648    private const int slaveGroupImageIndex = 1;
     49    private readonly Color ownedResourceColor = Color.LightGreen;
    4750    private TS.Task progressTask;
    4851    private bool stopProgressTask;
     52    private bool currentlyAuthorized;
    4953
    5054
     
    5660      HiveAdminClient.Instance.Refreshing += new EventHandler(Instance_Refreshing);
    5761      HiveAdminClient.Instance.Refreshed += new EventHandler(Instance_Refreshed);
    58     }
    59 
    60     public new void Dispose() {
    61       HiveAdminClient.Instance.Refreshing -= new EventHandler(Instance_Refreshing);
    62       HiveAdminClient.Instance.Refreshed -= new EventHandler(Instance_Refreshed);
     62
     63      Access.AccessClient.Instance.Refreshing += new EventHandler(AccessClient_Refreshing);
     64      Access.AccessClient.Instance.Refreshed += new EventHandler(AccessClient_Refreshed);
    6365    }
    6466
     
    8789      progressTask = new TS.Task(UpdateProgress);
    8890      progressTask.Start();
     91      SetEnabledStateOfControls();
    8992    }
    9093
    9194    void Instance_Refreshed(object sender, EventArgs e) {
    9295      stopProgressTask = true;
     96      SetEnabledStateOfControls();
     97    }
     98
     99    void AccessClient_Refreshing(object sender, EventArgs e) {
     100      stopProgressTask = false;
     101      progressTask = new TS.Task(UpdateProgress);
     102      progressTask.Start();
     103      SetEnabledStateOfControls();
     104    }
     105
     106    void AccessClient_Refreshed(object sender, EventArgs e) {
     107      stopProgressTask = true;
     108      SetEnabledStateOfControls();
    93109    }
    94110
     
    110126      if (Content == null) {
    111127        slaveView.Content = null;
     128        scheduleView.Content = null;
     129        permissionView.Content = null;
     130        permissionView.FetchSelectedUsers = null;
    112131        treeSlaveGroup.Nodes.Clear();
    113132      } else {
     133        permissionView.Content = Access.AccessClient.Instance;
    114134        treeSlaveGroup.Nodes.Clear();
    115135
     
    134154              tn.Tag = g;
    135155              tn.Text = g.Name;
     156              if (g.OwnerUserId == Access.UserInformation.Instance.User.Id) tn.BackColor = ownedResourceColor;
    136157
    137158              BuildSlaveGroupTree(g, tn);
     
    144165              stn.SelectedImageIndex = stn.ImageIndex;
    145166              stn.Tag = g;
     167              if (g.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor;
    146168              ungrp.Nodes.Add(stn);
    147169            }
     
    162184        stn.SelectedImageIndex = stn.ImageIndex;
    163185        stn.Tag = r;
     186        if (r.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor;
    164187        tn.Nodes.Add(stn);
    165188
     
    174197        btnRemoveGroup.Enabled = false;
    175198        btnSave.Enabled = false;
     199        btnPermissionsSave.Enabled = false;
     200        permissionView.Enabled = false;
     201        scheduleView.SetEnabledStateOfSchedule(false);
     202        btnPermissionsSave.Enabled = false;
     203        permissionView.Enabled = false;
    176204      } else {
    177205        btnAddGroup.Enabled = true;
    178206        btnRemoveGroup.Enabled = true;
    179207        btnSave.Enabled = true;
    180       }
    181     }
    182 
    183     private void treeSlaveGroup_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) {
    184       if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
    185         slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
    186       }
    187 
    188       slaveView.Content = (Resource)e.Node.Tag;
    189       HiveAdminClient.Instance.DowntimeForResourceId = ((Resource)e.Node.Tag).Id;
    190 
    191       if (e.Node.Tag is SlaveGroup) {
    192         slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
    193       }
    194 
    195       if (tabSlaveGroup.SelectedIndex == 1) {
    196         UpdateScheduleAsync();
     208        scheduleView.SetEnabledStateOfSchedule(IsAuthorized(slaveView.Content));
     209        btnPermissionsSave.Enabled = permissionView.FetchSelectedUsers != null;
     210        permissionView.Enabled = permissionView.FetchSelectedUsers != null;
     211      }
     212    }
     213
     214    private bool IsAuthorized(Resource resource) {
     215      return resource != null
     216          && resource.Name != UngroupedGroupName
     217          && resource.Id != Guid.Empty
     218          && UserInformation.Instance.UserExists
     219          && (resource.OwnerUserId == UserInformation.Instance.User.Id || HiveRoles.CheckAdminUserPermissions());
     220    }
     221
     222    private void treeSlaveGroup_AfterSelect(object sender, TreeViewEventArgs e) {
     223      if (e.Action != TreeViewAction.Unknown) {
     224        Resource selectedResource = ((Resource)e.Node.Tag);
     225        currentlyAuthorized = IsAuthorized(selectedResource);
     226        if (currentlyAuthorized) {
     227          permissionView.FetchSelectedUsers = new Func<List<Guid>>(() => {
     228            return HiveServiceLocator.Instance.CallHiveService<List<ResourcePermission>>(service => {
     229              return service.GetResourcePermissions(selectedResource.Id);
     230            }).Select(x => x.GrantedUserId).ToList();
     231          });
     232          if (!tabSlaveGroup.TabPages.Contains(tabPermissions)) tabSlaveGroup.TabPages.Add(tabPermissions);
     233        } else {
     234          permissionView.FetchSelectedUsers = null;
     235          btnPermissionsSave.Enabled = false;
     236          if (selectedResource.Id == Guid.Empty) {
     237            if (!tabSlaveGroup.TabPages.Contains(tabPermissions)) tabSlaveGroup.TabPages.Add(tabPermissions);
     238          } else tabSlaveGroup.TabPages.Remove(tabPermissions);
     239        }
     240
     241        if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
     242          slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
     243        }
     244
     245        slaveView.Content = selectedResource;
     246        HiveAdminClient.Instance.DowntimeForResourceId = selectedResource.Id;
     247
     248        if (selectedResource is SlaveGroup) {
     249          slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
     250        }
     251
     252        if (tabSlaveGroup.SelectedIndex == 1) {
     253          UpdateScheduleAsync();
     254        } else if (tabSlaveGroup.SelectedIndex == 2) {
     255          UpdatePermissionsAsync();
     256        }
    197257      }
    198258    }
     
    217277      SlaveGroup newGroup = new SlaveGroup();
    218278      newGroup.Name = "New Group";
     279      newGroup.OwnerUserId = UserInformation.Instance.User.Id;
    219280      Content.Add(newGroup);
    220281    }
     
    269330        if (destNode.TreeView == newNode.TreeView) {
    270331          if (destNode.Text == UngroupedGroupName || (destNode.Parent != null && destNode.Parent.Text == UngroupedGroupName)) {
    271             MessageBox.Show(String.Format("You can't drag items to the {0} group.{1}This group only contains slaves which haven't yet been assigned to a real group.",
     332            MessageBox.Show(string.Format("You can't drag items to the group \"{0}\".{1}This group only contains slaves which haven't yet been assigned to a real group.",
    272333              UngroupedGroupName, Environment.NewLine), "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Information);
    273334            return;
     
    285346
    286347          if (newNode.Tag is SlaveGroup && CheckParentsEqualsMovedNode(parentNode, newNode)) {
     348            return;
     349          }
     350
     351          SlaveGroup parent = (SlaveGroup)parentNode.Tag;
     352
     353          if (parent.OwnerUserId != null && !IsAuthorized(parent)) {
     354            MessageBox.Show(string.Format("You don't have the permissions to drag items to the group \"{0}\".", ((Resource)parentNode.Tag).Name),
     355              "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
    287356            return;
    288357          }
     
    330399    private void treeSlaveGroup_ItemDrag(object sender, ItemDragEventArgs e) {
    331400      TreeNode sourceNode = (TreeNode)e.Item;
    332       DoDragDrop(sourceNode, DragDropEffects.All);
     401      if (IsAuthorized((Resource)sourceNode.Tag))
     402        DoDragDrop(sourceNode, DragDropEffects.All);
    333403    }
    334404
     
    403473    private void UpdateSchedule() {
    404474      HiveAdminClient.Instance.RefreshCalendar();
    405       scheduleView.Invoke(new Action(() => scheduleView.Content = HiveAdminClient.Instance.Downtimes));
     475      scheduleView.Invoke(new Action(() => {
     476        scheduleView.Content = HiveAdminClient.Instance.Downtimes;
     477        SetEnabledStateOfControls();
     478      }));
    406479    }
    407480
     
    412485    }
    413486
     487    private void UpdatePermissions() {
     488      if (permissionView.Content != null && permissionView.FetchSelectedUsers != null)
     489        permissionView.Invoke(new Action(() => permissionView.ManualRefresh()));
     490    }
     491
     492    private void UpdatePermissionsAsync() {
     493      TS.Task.Factory.StartNew(UpdatePermissions).ContinueWith((t) => {
     494        DisplayError(t.Exception);
     495      }, TaskContinuationOptions.OnlyOnFaulted);
     496    }
     497
     498
    414499    private void DisplayError(Exception ex) {
    415500      MessageBox.Show(string.Format("An error occured while updating: {0} {1}", Environment.NewLine, ex.Message), "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     
    419504      if (tabSlaveGroup.SelectedIndex == 1) {
    420505        UpdateScheduleAsync();
     506      } else if (tabSlaveGroup.SelectedIndex == 2) {
     507        UpdatePermissionsAsync();
    421508      }
    422509    }
     
    429516      UpdateResourcesAsync();
    430517    }
     518
     519    private void btnPermissionsSave_Click(object sender, EventArgs e) {
     520      SetEnabledStateOfControls();
     521      HiveServiceLocator.Instance.CallHiveService(service => {
     522        service.GrantResourcePermissions(((Resource)treeSlaveGroup.SelectedNode.Tag).Id, permissionView.GetAddedUsers().Select(x => x.Id).ToList());
     523        service.RevokeResourcePermissions(((Resource)treeSlaveGroup.SelectedNode.Tag).Id, permissionView.GetDeletedUsers().Select(x => x.Id).ToList());
     524      });
     525      SetEnabledStateOfControls();
     526    }
    431527  }
    432528}
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs

    r7259 r8086  
    7171      this.dvOnline.ActiveTool = drawTool1;
    7272      this.dvOnline.AmPmDisplay = false;
    73       this.dvOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    74                   | System.Windows.Forms.AnchorStyles.Left)));
     73      this.dvOnline.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     74            | System.Windows.Forms.AnchorStyles.Left)
     75            | System.Windows.Forms.AnchorStyles.Right)));
    7576      this.dvOnline.AppointmentDuration = Calendar.AppointmentSlotDuration.SixtyMinutes;
    7677      this.dvOnline.AppointmentHeightMode = Calendar.AppHeightDrawMode.TrueHeightAll;
     
    8384      this.dvOnline.EnableTimeIndicator = false;
    8485      this.dvOnline.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F);
    85       this.dvOnline.Location = new System.Drawing.Point(9, 176);
     86      this.dvOnline.Location = new System.Drawing.Point(3, 183);
    8687      this.dvOnline.MinHalfHourApp = false;
    8788      this.dvOnline.Name = "dvOnline";
    8889      this.dvOnline.SelectionEnd = new System.DateTime(((long)(0)));
    8990      this.dvOnline.SelectionStart = new System.DateTime(((long)(0)));
    90       this.dvOnline.Size = new System.Drawing.Size(823, 354);
     91      this.dvOnline.Size = new System.Drawing.Size(836, 354);
    9192      this.dvOnline.StartDate = new System.DateTime(((long)(0)));
    9293      this.dvOnline.TabIndex = 54;
     
    123124      // groupBox1
    124125      //
     126      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    125127      this.groupBox1.Controls.Add(this.txttimeTo);
    126128      this.groupBox1.Controls.Add(this.txttimeFrom);
     
    133135      this.groupBox1.Controls.Add(this.label1);
    134136      this.groupBox1.Controls.Add(this.btCreate);
    135       this.groupBox1.Location = new System.Drawing.Point(373, 4);
     137      this.groupBox1.Location = new System.Drawing.Point(375, 3);
    136138      this.groupBox1.Name = "groupBox1";
    137       this.groupBox1.Size = new System.Drawing.Size(254, 161);
     139      this.groupBox1.Size = new System.Drawing.Size(259, 168);
    138140      this.groupBox1.TabIndex = 56;
    139141      this.groupBox1.TabStop = false;
     
    217219      // btnSaveCal
    218220      //
     221      this.btnSaveCal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    219222      this.btnSaveCal.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
    220223      this.btnSaveCal.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    221       this.btnSaveCal.Location = new System.Drawing.Point(633, 41);
     224      this.btnSaveCal.Location = new System.Drawing.Point(640, 41);
    222225      this.btnSaveCal.Name = "btnSaveCal";
    223226      this.btnSaveCal.Size = new System.Drawing.Size(199, 26);
     
    230233      // btnClearCal
    231234      //
     235      this.btnClearCal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    232236      this.btnClearCal.Image = HeuristicLab.Common.Resources.VSImageLibrary.Document;
    233237      this.btnClearCal.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
    234       this.btnClearCal.Location = new System.Drawing.Point(633, 9);
     238      this.btnClearCal.Location = new System.Drawing.Point(640, 9);
    235239      this.btnClearCal.Name = "btnClearCal";
    236240      this.btnClearCal.Size = new System.Drawing.Size(199, 26);
     
    243247      // mcOnline
    244248      //
     249      this.mcOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     250            | System.Windows.Forms.AnchorStyles.Right)));
    245251      this.mcOnline.CalendarDimensions = new System.Drawing.Size(2, 1);
    246       this.mcOnline.Location = new System.Drawing.Point(4, 9);
     252      this.mcOnline.Location = new System.Drawing.Point(3, 9);
    247253      this.mcOnline.Name = "mcOnline";
    248254      this.mcOnline.TabIndex = 55;
     
    251257      // ScheduleView
    252258      //
    253       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    254       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     259      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    255260      this.Controls.Add(this.dvOnline);
    256261      this.Controls.Add(this.groupBox1);
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs

    r7259 r8086  
    228228    protected override void SetEnabledStateOfControls() {
    229229      base.SetEnabledStateOfControls();
    230       if (Content == null) {
    231         btnSaveCal.Enabled = false;
     230    }
     231
     232    public virtual void SetEnabledStateOfSchedule(bool state) {
     233      if (InvokeRequired) {
     234        Invoke(new Action(() => SetEnabledStateOfSchedule(state)));
    232235      } else {
    233         btnSaveCal.Enabled = true;
     236        if (Content == null) state = false;
     237        groupBox1.Enabled = state;
     238        btnClearCal.Enabled = state;
     239        btnSaveCal.Enabled = state;
    234240      }
    235241    }
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.Designer.cs

    r7259 r8086  
    6565      this.label3 = new System.Windows.Forms.Label();
    6666      this.txtHbIntervall = new System.Windows.Forms.TextBox();
     67      this.cbxDisposable = new System.Windows.Forms.CheckBox();
     68      this.label4 = new System.Windows.Forms.Label();
     69      this.cbxPublic = new System.Windows.Forms.CheckBox();
     70      this.label5 = new System.Windows.Forms.Label();
    6771      this.SuspendLayout();
    6872      //
     
    7074      //
    7175      this.txtSlaveState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    72                   | System.Windows.Forms.AnchorStyles.Right)));
     76            | System.Windows.Forms.AnchorStyles.Right)));
    7377      this.txtSlaveState.Enabled = false;
    74       this.txtSlaveState.Location = new System.Drawing.Point(146, 216);
     78      this.txtSlaveState.Location = new System.Drawing.Point(146, 242);
    7579      this.txtSlaveState.Name = "txtSlaveState";
    7680      this.txtSlaveState.Size = new System.Drawing.Size(390, 20);
     
    8084      //
    8185      this.txtOS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    82                   | System.Windows.Forms.AnchorStyles.Right)));
     86            | System.Windows.Forms.AnchorStyles.Right)));
    8387      this.txtOS.Enabled = false;
    84       this.txtOS.Location = new System.Drawing.Point(146, 190);
     88      this.txtOS.Location = new System.Drawing.Point(146, 216);
    8589      this.txtOS.Name = "txtOS";
    8690      this.txtOS.Size = new System.Drawing.Size(390, 20);
     
    9094      //
    9195      this.label15.AutoSize = true;
    92       this.label15.Location = new System.Drawing.Point(3, 219);
     96      this.label15.Location = new System.Drawing.Point(3, 245);
    9397      this.label15.Name = "label15";
    9498      this.label15.Size = new System.Drawing.Size(35, 13);
     
    99103      //
    100104      this.label14.AutoSize = true;
    101       this.label14.Location = new System.Drawing.Point(3, 193);
     105      this.label14.Location = new System.Drawing.Point(3, 219);
    102106      this.label14.Name = "label14";
    103107      this.label14.Size = new System.Drawing.Size(93, 13);
     
    108112      //
    109113      this.txtDetailsDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    110                   | System.Windows.Forms.AnchorStyles.Right)));
     114            | System.Windows.Forms.AnchorStyles.Right)));
    111115      this.txtDetailsDescription.Enabled = false;
    112       this.txtDetailsDescription.Location = new System.Drawing.Point(146, 86);
     116      this.txtDetailsDescription.Location = new System.Drawing.Point(146, 112);
    113117      this.txtDetailsDescription.Name = "txtDetailsDescription";
    114118      this.txtDetailsDescription.Size = new System.Drawing.Size(390, 20);
     
    118122      //
    119123      this.label13.AutoSize = true;
    120       this.label13.Location = new System.Drawing.Point(3, 89);
     124      this.label13.Location = new System.Drawing.Point(3, 115);
    121125      this.label13.Name = "label13";
    122126      this.label13.Size = new System.Drawing.Size(63, 13);
     
    127131      //
    128132      this.txtName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    129                   | System.Windows.Forms.AnchorStyles.Right)));
     133            | System.Windows.Forms.AnchorStyles.Right)));
    130134      this.txtName.Location = new System.Drawing.Point(146, 8);
    131135      this.txtName.Name = "txtName";
     
    137141      //
    138142      this.txtCPU.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    139                   | System.Windows.Forms.AnchorStyles.Right)));
     143            | System.Windows.Forms.AnchorStyles.Right)));
    140144      this.txtCPU.Enabled = false;
    141       this.txtCPU.Location = new System.Drawing.Point(146, 112);
     145      this.txtCPU.Location = new System.Drawing.Point(146, 138);
    142146      this.txtCPU.Name = "txtCPU";
    143147      this.txtCPU.Size = new System.Drawing.Size(390, 20);
     
    147151      //
    148152      this.txtMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    149                   | System.Windows.Forms.AnchorStyles.Right)));
     153            | System.Windows.Forms.AnchorStyles.Right)));
    150154      this.txtMemory.Enabled = false;
    151       this.txtMemory.Location = new System.Drawing.Point(146, 138);
     155      this.txtMemory.Location = new System.Drawing.Point(146, 164);
    152156      this.txtMemory.Name = "txtMemory";
    153157      this.txtMemory.Size = new System.Drawing.Size(390, 20);
     
    157161      //
    158162      this.txtLastHeartbeat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    159                   | System.Windows.Forms.AnchorStyles.Right)));
     163            | System.Windows.Forms.AnchorStyles.Right)));
    160164      this.txtLastHeartbeat.Enabled = false;
    161       this.txtLastHeartbeat.Location = new System.Drawing.Point(146, 242);
     165      this.txtLastHeartbeat.Location = new System.Drawing.Point(146, 268);
    162166      this.txtLastHeartbeat.Name = "txtLastHeartbeat";
    163167      this.txtLastHeartbeat.Size = new System.Drawing.Size(390, 20);
     
    167171      //
    168172      this.label12.AutoSize = true;
    169       this.label12.Location = new System.Drawing.Point(3, 245);
     173      this.label12.Location = new System.Drawing.Point(3, 271);
    170174      this.label12.Name = "label12";
    171175      this.label12.Size = new System.Drawing.Size(80, 13);
     
    176180      //
    177181      this.label11.AutoSize = true;
    178       this.label11.Location = new System.Drawing.Point(3, 141);
     182      this.label11.Location = new System.Drawing.Point(3, 167);
    179183      this.label11.Name = "label11";
    180184      this.label11.Size = new System.Drawing.Size(47, 13);
     
    185189      //
    186190      this.label10.AutoSize = true;
    187       this.label10.Location = new System.Drawing.Point(3, 115);
     191      this.label10.Location = new System.Drawing.Point(3, 141);
    188192      this.label10.Name = "label10";
    189193      this.label10.Size = new System.Drawing.Size(32, 13);
     
    203207      //
    204208      this.label1.AutoSize = true;
    205       this.label1.Location = new System.Drawing.Point(3, 167);
     209      this.label1.Location = new System.Drawing.Point(3, 193);
    206210      this.label1.Name = "label1";
    207211      this.label1.Size = new System.Drawing.Size(70, 13);
     
    212216      //
    213217      this.txtFreeMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    214                   | System.Windows.Forms.AnchorStyles.Right)));
     218            | System.Windows.Forms.AnchorStyles.Right)));
    215219      this.txtFreeMemory.Enabled = false;
    216       this.txtFreeMemory.Location = new System.Drawing.Point(146, 164);
     220      this.txtFreeMemory.Location = new System.Drawing.Point(146, 190);
    217221      this.txtFreeMemory.Name = "txtFreeMemory";
    218222      this.txtFreeMemory.Size = new System.Drawing.Size(390, 20);
     
    222226      //
    223227      this.txtId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    224                   | System.Windows.Forms.AnchorStyles.Right)));
     228            | System.Windows.Forms.AnchorStyles.Right)));
    225229      this.txtId.Enabled = false;
    226       this.txtId.Location = new System.Drawing.Point(146, 60);
     230      this.txtId.Location = new System.Drawing.Point(146, 86);
    227231      this.txtId.Name = "txtId";
    228232      this.txtId.Size = new System.Drawing.Size(390, 20);
     
    232236      //
    233237      this.label2.AutoSize = true;
    234       this.label2.Location = new System.Drawing.Point(3, 63);
     238      this.label2.Location = new System.Drawing.Point(3, 89);
    235239      this.label2.Name = "label2";
    236240      this.label2.Size = new System.Drawing.Size(19, 13);
     
    250254      //
    251255      this.txtHbIntervall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    252                   | System.Windows.Forms.AnchorStyles.Right)));
     256            | System.Windows.Forms.AnchorStyles.Right)));
    253257      this.txtHbIntervall.Location = new System.Drawing.Point(146, 34);
    254258      this.txtHbIntervall.Name = "txtHbIntervall";
     
    257261      this.txtHbIntervall.TextChanged += new System.EventHandler(this.txtHbIntervall_TextChanged);
    258262      //
     263      // cbxDisposable
     264      //
     265      this.cbxDisposable.AutoSize = true;
     266      this.cbxDisposable.Enabled = false;
     267      this.cbxDisposable.Location = new System.Drawing.Point(146, 297);
     268      this.cbxDisposable.Name = "cbxDisposable";
     269      this.cbxDisposable.Size = new System.Drawing.Size(15, 14);
     270      this.cbxDisposable.TabIndex = 34;
     271      this.cbxDisposable.UseVisualStyleBackColor = true;
     272      this.cbxDisposable.CheckedChanged += new System.EventHandler(this.cbxDisposable_CheckedChanged);
     273      //
     274      // label4
     275      //
     276      this.label4.AutoSize = true;
     277      this.label4.Location = new System.Drawing.Point(3, 297);
     278      this.label4.Name = "label4";
     279      this.label4.Size = new System.Drawing.Size(62, 13);
     280      this.label4.TabIndex = 35;
     281      this.label4.Text = "Disposable:";
     282      //
     283      // cbxPublic
     284      //
     285      this.cbxPublic.AutoSize = true;
     286      this.cbxPublic.Enabled = false;
     287      this.cbxPublic.Location = new System.Drawing.Point(146, 63);
     288      this.cbxPublic.Name = "cbxPublic";
     289      this.cbxPublic.Size = new System.Drawing.Size(15, 14);
     290      this.cbxPublic.TabIndex = 36;
     291      this.cbxPublic.UseVisualStyleBackColor = true;
     292      this.cbxPublic.CheckedChanged += new System.EventHandler(this.cbxPublic_CheckedChanged);
     293      //
     294      // label5
     295      //
     296      this.label5.AutoSize = true;
     297      this.label5.Location = new System.Drawing.Point(3, 63);
     298      this.label5.Name = "label5";
     299      this.label5.Size = new System.Drawing.Size(39, 13);
     300      this.label5.TabIndex = 37;
     301      this.label5.Text = "Public:";
     302      //
    259303      // SlaveView
    260304      //
    261305      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    262       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     306      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     307      this.Controls.Add(this.label5);
     308      this.Controls.Add(this.cbxPublic);
     309      this.Controls.Add(this.label4);
     310      this.Controls.Add(this.cbxDisposable);
    263311      this.Controls.Add(this.txtHbIntervall);
    264312      this.Controls.Add(this.label3);
     
    282330      this.Controls.Add(this.label9);
    283331      this.Name = "SlaveView";
    284       this.Size = new System.Drawing.Size(539, 267);
     332      this.Size = new System.Drawing.Size(539, 407);
    285333      this.ResumeLayout(false);
    286334      this.PerformLayout();
     
    310358    private System.Windows.Forms.Label label3;
    311359    private System.Windows.Forms.TextBox txtHbIntervall;
     360    private System.Windows.Forms.CheckBox cbxDisposable;
     361    private System.Windows.Forms.Label label4;
     362    private System.Windows.Forms.CheckBox cbxPublic;
     363    private System.Windows.Forms.Label label5;
    312364  }
    313365}
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs

    r7259 r8086  
    2222using System;
    2323using System.Windows.Forms;
     24using HeuristicLab.Clients.Access;
    2425using HeuristicLab.Core.Views;
    2526using HeuristicLab.MainForm;
     
    6263        txtId.Clear();
    6364        txtHbIntervall.Clear();
     65        cbxDisposable.Checked = false;
     66        cbxPublic.Checked = false;
    6467      } else {
    6568        if (Content.GetType() == typeof(Slave)) {
    6669          ShowSlaveUI(true);
    6770          Slave ct = (Slave)Content;
     71          bool authorized = UserInformation.Instance.UserExists && (ct.OwnerUserId == UserInformation.Instance.User.Id || HiveRoles.CheckAdminUserPermissions());
    6872          txtName.Text = ct.Name;
    6973          txtHbIntervall.Text = ct.HbInterval.ToString();
     74          cbxPublic.Enabled = authorized;
     75          cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged);
     76          cbxPublic.Checked = ct.OwnerUserId == null;
     77          cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged);
    7078          txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString());
    7179          txtDetailsDescription.Text = ct.Description;
     
    7684          txtFreeMemory.Text = ct.FreeMemory.ToString();
    7785          txtId.Text = ct.Id.ToString();
     86          cbxDisposable.Enabled = authorized;
     87          cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault();
    7888        } else if (Content.GetType() == typeof(SlaveGroup)) {
    7989          SlaveGroup ct = (SlaveGroup)Content;
    8090          txtName.Text = ct.Name;
    8191          txtHbIntervall.Text = ct.HbInterval.ToString();
     92          cbxPublic.Enabled = ct.Name != "UNGROUPED" && HiveRoles.CheckAdminUserPermissions();
     93          cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged);
     94          cbxPublic.Checked = ct.OwnerUserId == null;
     95          cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged);
    8296          ShowSlaveUI(false);
    8397        } else {
     
    88102
    89103    private void ShowSlaveUI(bool show) {
     104      label1.Visible = show;
    90105      label2.Visible = show;
    91       label1.Visible = show;
     106      label4.Visible = show;
    92107      label10.Visible = show;
    93108      label11.Visible = show;
     
    105120      txtId.Visible = show;
    106121      txtName.Enabled = !show;
     122      cbxDisposable.Visible = show;
    107123    }
    108124
     
    131147      }
    132148    }
     149
     150    private void cbxDisposable_CheckedChanged(object sender, EventArgs e) {
     151      if (Content != null) {
     152        ((Slave)Content).IsDisposable = cbxDisposable.Checked;
     153      }
     154    }
     155
     156    private void cbxPublic_CheckedChanged(object sender, EventArgs e) {
     157      if (Content != null) {
     158        Content.OwnerUserId = cbxPublic.Checked ? null : new Guid?(UserInformation.Instance.User.Id);
     159      }
     160    }
    133161  }
    134162}
Note: See TracChangeset for help on using the changeset viewer.