public void CopyGraph(String graphUri, IGenericIOManager target) { if (target == null) { return; } Uri source = graphUri.Equals("Default Graph") ? null : new Uri(graphUri); if (ReferenceEquals(this._manager, target)) { CopyMoveRenameGraphForm rename = new CopyMoveRenameGraphForm("Copy"); if (rename.ShowDialog() == DialogResult.OK) { CopyMoveTask task = new CopyMoveTask(this._manager, target, source, rename.Uri, ReferenceEquals(this._manager, target)); this.AddTask(task, this.CopyMoveRenameCallback); } } else { CopyMoveTask task = new CopyMoveTask(this._manager, target, source, source, true); this.AddTask(task, this.CopyMoveRenameCallback); } }
private void CopyMoveRenameCallback(ITask <TaskResult> task) { if (task.State == TaskState.Completed) { CrossThreadMessage(task.Name + " Completed OK - " + task.Information, task.Name + " Completed", MessageBoxIcon.Information); this.ListGraphs(); if (task is CopyMoveTask) { CopyMoveTask cmTask = (CopyMoveTask)task; if (!ReferenceEquals(this._manager, cmTask.Target)) { foreach (StoreManagerForm managerForm in Program.MainForm.MdiChildren.OfType <StoreManagerForm>()) { if (!ReferenceEquals(this, managerForm) && ReferenceEquals(cmTask.Target, managerForm.Manager)) { managerForm.ListGraphs(); break; } } } } } else { if (task.Error != null) { CrossThreadMessage(task.Name + " Failed due to the following error: " + task.Error.Message, task.Name + " Failed", MessageBoxIcon.Error); } else { CrossThreadMessage(task.Name + " Failed due to an unknown error", task.Name + " Failed", MessageBoxIcon.Error); } } }
private void RenameGraph(String graphUri) { CopyMoveRenameGraphForm rename = new CopyMoveRenameGraphForm("Rename"); Uri source = graphUri.Equals("Default Graph") ? null : new Uri(graphUri); if (rename.ShowDialog() == DialogResult.OK) { CopyMoveTask task = new CopyMoveTask(this._manager, this._manager, source, rename.Uri, false); this.AddTask <TaskResult>(task, this.CopyMoveRenameCallback); } }
public void MoveGraph(String graphUri, IGenericIOManager target) { if (target == null) { return; } if (ReferenceEquals(this._manager, target)) { this.RenameGraph(graphUri); } else { Uri source = graphUri.Equals("Default Graph") ? null : new Uri(graphUri); CopyMoveTask task = new CopyMoveTask(this._manager, target, source, source, false); this.AddTask <TaskResult>(task, this.CopyMoveRenameCallback); } }