private void createButton_Click(object sender, EventArgs e) { string origin = junctionTextBox.Text; string target = targetTextBox.Text; if (origin.Length == 0) { ActiveControl = junctionTextBox; System.Media.SystemSounds.Exclamation.Play(); return; } else if (target.Length == 0) { ActiveControl = targetTextBox; System.Media.SystemSounds.Exclamation.Play(); return; } if (!Directory.Exists(target)) { DialogResult recursionCaution = MessageBox.Show("There is no folder at " + target + ", please select a folder that the junction can target", "Folder doesn't exist", MessageBoxButtons.OK); } DialogResult confirmDialog = MessageBox.Show("Are you sure you want to create a junction at " + origin + " that links to " + target + "?", "Confirmation", MessageBoxButtons.YesNo); if (confirmDialog == DialogResult.No) { return; } JunctionPoint.Create(origin, target, true); SQLiteManager.AddJunction(origin, target); }
public static void MoveWithJunction(string origin, string target) { //Copy folder and delete the original folder (essentially a move" Program.CopyFolder(origin, target); Directory.Delete(origin, true); Program.Log("INFO: Moved " + origin + " to " + target); //Create a junction at the original location pointing to the new location JunctionPoint.Create(origin, target, true); //Update the SQLite database with the new junction created SQLiteManager.AddJunction(origin, target); }
private void button2_Click(object sender, EventArgs e) { if (junctionPathBox.Text.Length == 0) { ActiveControl = junctionPathBox; System.Media.SystemSounds.Exclamation.Play(); } else { string origin = junctionPathBox.Text; if (JunctionPoint.Exists(origin)) { string target = JunctionPoint.GetTarget(origin); SQLiteManager.AddJunction(origin, target); Close(); } } }