private void RenameTaskToolStripMenuItem_Click(object sender, EventArgs e) { string oldTaskName = WorkspaceTreeView.SelectedNode.Text; RenameForm renameForm = new RenameForm("Rename task", oldTaskName); renameForm.CheckInputDelegate = new CheckInputDelegate(CheckTaskName); if (DialogResult.OK == renameForm.ShowDialog() && renameForm.Updated) { UpdateTaskRequest request = new UpdateTaskRequest(); request.Type = UpdateTaskType.RenameTask.ToString(); request.NewName = renameForm.NewName; long taskID = ((TaskModel)WorkspaceTreeView.SelectedNode.Tag).mTask.ID; HTTPAgent.instance().updateTask(this, taskID, request, "Rename task '" + oldTaskName + "'", WorkspaceTreeView.SelectedNode); } }
private void RenameRegionToolStripMenuItem_Click(object sender, EventArgs e) { string oldRegionName = WorkspaceTreeView.SelectedNode.Text; RenameForm renameForm = new RenameForm("Rename region", oldRegionName); renameForm.CheckInputDelegate = new CheckInputDelegate(CheckRegionName); if (DialogResult.OK == renameForm.ShowDialog() && renameForm.Updated) { UpdateRegionRequest request = new UpdateRegionRequest(); request.Type = UpdateRegionType.RenameRegion.ToString(); request.Region = new SubRegion(); request.Region.Name = renameForm.NewName; request.Region.ID = ((SubRegion)WorkspaceTreeView.SelectedNode.Tag).ID; HTTPAgent.instance().updateRegion(this, DataCenter.Instance().GlobalRegion.Version, request, "Rename region '" + oldRegionName + "'", WorkspaceTreeView.SelectedNode); } }
private void RenameMapToolStripMenuItem_Click(object sender, EventArgs e) { MapModel mapModel = (MapModel)WorkspaceTreeView.SelectedNode.Tag; RenameForm renameForm = new RenameForm("Rename map view", mapModel.Name); if (DialogResult.OK == renameForm.ShowDialog() && renameForm.Updated) { mapModel.Name = renameForm.NewName; WorkspaceTreeView.SelectedNode.Text = renameForm.NewName; } }
private void RenameAnalysisToolStripMenuItem_Click(object sender, EventArgs e) { AnalysisModel analysisModel = (AnalysisModel)WorkspaceTreeView.SelectedNode.Tag; RenameForm renameForm = new RenameForm("Rename analysis", analysisModel.Name); if (DialogResult.OK == renameForm.ShowDialog() && renameForm.Updated) { analysisModel.Name = renameForm.NewName; WorkspaceTreeView.SelectedNode.Text = renameForm.NewName; //analysisModel.TableViewModel. //analysisModel.MapViewModel. analysisModel.ReportViewModel.ReportForm.Text = "Report View - " + renameForm.NewName; } }
private void NewMapViewToolStripMenuItem_Click(object sender, EventArgs e) { MapModel mapModel = new MapModel(); mapModel.Name = "MapView-" + Utility.GetTimeStr(); TreeNode mapNode = WorkspaceTreeView.SelectedNode.Nodes.Add(mapModel.Name); mapNode.Tag = mapModel; mapNode.SelectedImageIndex = mapNode.ImageIndex = ICON_SITES; mapNode.Parent.Expand(); WorkspaceTreeView.SelectedNode = mapNode; RenameForm renameForm = new RenameForm("Rename map view name", mapModel.Name); if (DialogResult.OK == renameForm.ShowDialog() && renameForm.Updated) { mapNode.Text = renameForm.NewName; mapModel.Name = renameForm.NewName; } }
private void NewAnalysisToolStripMenuItem_Click(object sender, EventArgs e) { TaskModel taskModel = (TaskModel)WorkspaceTreeView.SelectedNode.Parent.Tag; string taskName = taskModel.mTask.Name; //Analysis Node AnalysisModel analysisModel = new AnalysisModel(); analysisModel.Name = "Analysis-" + Utility.GetTimeStr(); taskModel.AnalysisModelList.Add(analysisModel); TreeNode analysisNode = WorkspaceTreeView.SelectedNode.Nodes.Add(analysisModel.Name); analysisNode.Tag = analysisModel; analysisNode.SelectedImageIndex = analysisNode.ImageIndex = ICON_ANALYSIS; analysisNode.Parent.Expand(); WorkspaceTreeView.SelectedNode = analysisNode; //Table View Node TreeNode tableViewNode = analysisNode.Nodes.Add("Table View"); tableViewNode.ImageIndex = tableViewNode.SelectedImageIndex = ICON_TABLEVIEW; AnalysisTableViewModel tableViewModel = new AnalysisTableViewModel(analysisNode); tableViewNode.Tag = tableViewModel; analysisModel.TableViewModel = tableViewModel; //Map View Node TreeNode mapViewNode = analysisNode.Nodes.Add("Map View"); mapViewNode.ImageIndex = mapViewNode.SelectedImageIndex = ICON_MAPVIEW; AnalysisMapViewModel mapViewModel = new AnalysisMapViewModel(); mapViewNode.Tag = mapViewModel; analysisModel.MapViewModel = mapViewModel; //Report View Node TreeNode reportViewNode = analysisNode.Nodes.Add("Report View"); reportViewNode.ImageIndex = reportViewNode.SelectedImageIndex = ICON_REPORTVIEW; AnalysisReportViewModel reportViewModel = new AnalysisReportViewModel(analysisNode); reportViewNode.Tag = reportViewModel; analysisModel.ReportViewModel = reportViewModel; analysisNode.ExpandAll(); RenameForm renameForm = new RenameForm("Rename analysis name", analysisModel.Name); if (DialogResult.OK == renameForm.ShowDialog() && renameForm.Updated) { analysisNode.Text = renameForm.NewName; analysisModel.Name = renameForm.NewName; } }