private void DrawControls() { tpConfigurationRelationships.Controls.Clear(); int index = 0; foreach (Model.Environment environment in universe.Environments) { EnvironmentControl control = new EnvironmentControl(); control.Environment = environment; control.Location = positions.ContainsKey(environment.Name) ? positions[environment.Name] : new Point(10, (control.Height + 10) * index++); tpConfigurationRelationships.Controls.Add(control); positions[environment.Name] = control.Location; } index = 0; foreach (Server server in universe.Servers) { ServerControl control = new ServerControl(); control.Server = server; control.Location = positions.ContainsKey(server.Name) ? positions[server.Name] : new Point(350, (control.Height + 10) * index++); tpConfigurationRelationships.Controls.Add(control); positions[server.Name] = control.Location; } index = 0; foreach (ReleaseTask releaseTask in universe.ReleaseTasks) { ReleaseTaskControl control = new ReleaseTaskControl(); control.ReleaseTask = releaseTask; control.Location = positions.ContainsKey(releaseTask.Title) ? positions[releaseTask.Title] : new Point(700, (control.Height + 10) * index++); tpConfigurationRelationships.Controls.Add(control); positions[releaseTask.Title] = control.Location; } index = 0; foreach (Model.Component component in universe.Components) { ComponentControl control = new ComponentControl(); control.Component = component; control.Location = positions.ContainsKey(component.Name) ? positions[component.Name] : new Point(1050, (control.Height + 10) * index++); tpConfigurationRelationships.Controls.Add(control); positions[component.Name] = control.Location; } SaveControlsPositions(); }
private void ReleaseTaskControl_DragDrop(object sender, DragEventArgs e) { ComponentControl componentControl = e.Data.GetData(typeof(ComponentControl)) as ComponentControl; componentControl.AddReleaseTask(_releaseTask); }