public static void Main() { // ... DirectoryInfo directory = new DirectoryInfo(".\\Source"); directory.MoveTo(".\\Root"); DirectoryInfoExtension.CopyTo( directory, ".\\Target", SearchOption.AllDirectories, "*"); // ... }
static void Main() { Employee employee1; Employee employee2 = new Employee(); employee2.SetName("Inigo", "Montoya"); employee2.Save(); // Modify employee2 after saving. IncreaseSalary(employee2); // Load employee1 from the saved version of employee2 employee1 = DataStorage.Load("Inigo", "Montoya"); Console.WriteLine($"{ employee1.GetName() }: { employee1.Salary }"); // ... // ... DirectoryInfo directory = new DirectoryInfo(".\\Source"); directory.MoveTo(".\\Root"); DirectoryInfoExtension.CopyTo( directory, ".\\Target", SearchOption.AllDirectories, "*"); // .. }