using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core; using Tango.PMR.IO; namespace Tango.Integration.Storage { public abstract class StorageItem : ExtendedObject { private String _path; public String Path { get { return _path; } set { _path = value; RaisePropertyChangedAuto(); } } public String Name { get { return System.IO.Path.GetFileName(Path); } } public String Parent { get { if (Path == "/" || Path == null) return null; String root = System.IO.Path.GetPathRoot(Path); var parent = Directory.GetParent(Path); if (root == "\\") { return parent.FullName.Replace(parent.Root.FullName, "/").Replace("\\", "/"); } else if (parent != null) { return parent.FullName; } else { return null; } } } public DateTime LastModified { get; set; } public FileAttribute Attribute { get; set; } } }