Changeset 1377 for trunk/sources/HeuristicLab.Hive.Server.Console
- Timestamp:
- 03/20/09 13:37:39 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.Console
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/HeuristicLab.Hive.Server.Console.csproj
r1120 r1377 73 73 </ItemGroup> 74 74 <ItemGroup> 75 <Compile Include="AddUserForm.cs">76 <SubType>Form</SubType>77 </Compile>78 <Compile Include="AddUserForm.Designer.cs">79 <DependentUpon>AddUserForm.cs</DependentUpon>80 </Compile>81 75 <Compile Include="AddJobForm.cs"> 82 76 <SubType>Form</SubType> … … 100 94 <Compile Include="HiveServerConsolePlugin.cs" /> 101 95 <Compile Include="Properties\AssemblyInfo.cs" /> 102 <EmbeddedResource Include="AddUserForm.resx">103 <DependentUpon>AddUserForm.cs</DependentUpon>104 </EmbeddedResource>105 96 <EmbeddedResource Include="AddJobForm.resx"> 106 97 <DependentUpon>AddJobForm.cs</DependentUpon> … … 142 133 <Name>HeuristicLab.Core</Name> 143 134 </ProjectReference> 135 <ProjectReference Include="..\HeuristicLab.DataAccess\HeuristicLab.DataAccess.csproj"> 136 <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project> 137 <Name>HeuristicLab.DataAccess</Name> 138 </ProjectReference> 144 139 <ProjectReference Include="..\HeuristicLab.Hive.Contracts\HeuristicLab.Hive.Contracts.csproj"> 145 140 <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project> -
trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.Designer.cs
r1261 r1377 164 164 this.userToolStripMenuItem1.Size = new System.Drawing.Size(114, 22); 165 165 this.userToolStripMenuItem1.Text = "User"; 166 this.userToolStripMenuItem1.Click += new System.EventHandler(this.AddUser_Click);167 166 // 168 167 // groupToolStripMenuItem2 … … 171 170 this.groupToolStripMenuItem2.Size = new System.Drawing.Size(114, 22); 172 171 this.groupToolStripMenuItem2.Text = "Group"; 173 this.groupToolStripMenuItem2.Click += new System.EventHandler(this.AddUserGroup_Click);174 172 // 175 173 // tcManagementConsole … … 337 335 this.tvUserControl.Size = new System.Drawing.Size(139, 346); 338 336 this.tvUserControl.TabIndex = 1; 339 this.tvUserControl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnTVUserControlClicked);340 337 // 341 338 // lvUserControl … … 349 346 this.lvUserControl.TabIndex = 1; 350 347 this.lvUserControl.UseCompatibleStateImageBehavior = false; 351 this.lvUserControl.Click += new System.EventHandler(this.OnLVUserControlClicked);352 348 // 353 349 // ilUserControl -
trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
r1267 r1377 44 44 private ResponseList<ClientInfo> clientInfo = null; 45 45 private ResponseList<Job> jobs = null; 46 private ResponseList<UserGroup> userGroups = null;47 private ResponseList<User> usersList = null;48 46 49 47 private Dictionary<long, ListViewGroup> clientObjects; … … 55 53 private Job currentJob = null; 56 54 private ClientInfo currentClient = null; 57 private User currentUser = null;58 55 private string nameCurrentJob = ""; 59 56 private string nameCurrentClient = ""; … … 70 67 AddClients(); 71 68 AddJobs(); 72 AddUsers();73 69 timerSyncronize.Start(); 74 70 } … … 182 178 183 179 /// <summary> 184 /// Adds users to ListView and TreeView185 /// </summary>186 private void AddUsers() {187 try {188 userGroupsObjects = new Dictionary<long, ListViewGroup>();189 userListObjects = new Dictionary<long, ListViewItem>();190 IUserRoleManager userRoleManager =191 ServiceLocator.GetUserRoleManager();192 193 userGroups = userRoleManager.GetAllUserGroups();194 195 lvUserControl.Items.Clear();196 tvUserControl.Nodes.Clear();197 198 foreach (UserGroup ug in userGroups.List) {199 tvUserControl.Nodes.Add(ug.Name);200 ListViewGroup lvg = new ListViewGroup(ug.Name, HorizontalAlignment.Left);201 202 foreach (PermissionOwner permOwner in ug.Members) {203 if (permOwner is User) {204 User users = permOwner as User;205 tvUserControl.Nodes[tvUserControl.Nodes.Count - 1].Nodes.Add(users.Name);206 ListViewItem item = new ListViewItem(users.Name, 0, lvg);207 lvUserControl.Items.Add(item);208 userListObjects.Add(users.Id, item);209 }210 }211 lvUserControl.Groups.Add(lvg);212 userGroupsObjects.Add(ug.Id, lvg);213 214 } // Users215 usersList = userRoleManager.GetAllUsers();216 ListViewGroup lvunsorted = new ListViewGroup("unsorted", HorizontalAlignment.Left);217 foreach (User u in usersList.List) {218 tvUserControl.Nodes.Add(u.Name);219 lvUserControl.Items.Add(new ListViewItem(u.Name, 0, lvunsorted));220 }221 lvUserControl.Groups.Add(lvunsorted);222 if (flagUser) {223 UserClicked();224 }225 }226 catch (Exception ex) {227 closeFormEvent(true, true);228 this.Close();229 }230 }231 232 /// <summary>233 180 /// if one client is clicked, a panel is opened with the details 234 181 /// </summary> … … 320 267 } 321 268 322 /// <summary>323 /// if one user is clicked, a panel is opened with the details324 /// </summary>325 private void UserClicked() {326 int i = 0;327 while (usersList.List[i].Name != nameCurrentUser) {328 i++;329 }330 currentUser = usersList.List[i];331 scUserControl.Panel2.Controls.Clear();332 scUserControl.Panel2.Controls.Add(plUserDetails);333 pbUserControl.Image = ilUserControl.Images[0];334 lblUserName.Text = currentUser.Id.ToString();335 }336 337 269 #region Eventhandlers 338 270 /// <summary> … … 368 300 AddClients(); 369 301 AddJobs(); 370 AddUsers();371 }372 373 private void AddUser_Click(object sender, EventArgs e) {374 AddUserForm newForm = new AddUserForm("User", false);375 newForm.Show();376 newForm.addUserEvent += new addDelegate(Refresh);377 }378 379 private void AddUserGroup_Click(object sender, EventArgs e) {380 AddUserForm newForm = new AddUserForm("User", true);381 newForm.Show();382 newForm.addUserEvent += new addDelegate(Refresh);383 302 } 384 303 … … 419 338 420 339 } 421 422 private void OnLVUserControlClicked(object sender, EventArgs e) {423 nameCurrentUser = lvUserControl.SelectedItems[0].Text;424 flagUser = true;425 UserClicked();426 }427 428 private void OnTVUserControlClicked(object sender, TreeViewEventArgs e) {429 bool usergroup = false;430 foreach (UserGroup ug in userGroups.List) {431 if (tvUserControl.SelectedNode.Text == ug.Name) {432 usergroup = true;433 }434 }435 if (usergroup == false) {436 nameCurrentUser = tvUserControl.SelectedNode.Text;437 flagUser = true;438 UserClicked();439 }440 441 }442 443 340 444 341 private void btnClientClose_Click(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.Hive.Server.Console/ServiceLocator.cs
r1136 r1377 20 20 internal static IJobManager GetJobManager() { 21 21 return GetServerConsoleFacade() as IJobManager; 22 }23 24 internal static IUserRoleManager GetUserRoleManager() {25 return GetServerConsoleFacade() as IUserRoleManager;26 22 } 27 23
Note: See TracChangeset
for help on using the changeset viewer.