Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication60
- {
- class Program
- {
- static void Main(string[] args)
- {
- Folder currentFolder = new Folder("D:\\Folder1\\Folder2");
- Folder parentFolder = new Folder("D:\\Folder1");
- Folder childFolder = new Folder("D:\\Folder1\\Folder2\\Folder3");
- parentFolder.ChildFolder = currentFolder;
- parentFolder.ParentFolder = null;
- currentFolder.ChildFolder = childFolder;
- currentFolder.ParentFolder = parentFolder;
- childFolder.ParentFolder = currentFolder;
- childFolder.ChildFolder = null;
- Console.WriteLine(currentFolder.Path);
- Console.WriteLine(currentFolder.ParentFolder.ChildFolder.Path);
- }
- }
- class Folder
- {
- public Folder(string cur)
- {
- Path = cur;
- }
- public string Path
- {
- get;
- set;
- }
- public Folder ParentFolder
- {
- get;
- set;
- }
- public Folder ChildFolder
- {
- get;
- set;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement