public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value is string path) { return(FsPathPersistence.Deserialize(path)); } return(base.ConvertFrom(context, culture, value)); }
public override bool IsValid(ITypeDescriptorContext context, object value) { if (value is string path) { return(FsPathPersistence.Deserialize(path).IsValid()); } return(base.IsValid(context, value)); }
public static FileSignature[] ReadFromFile(FsPath targetFile, bool internPath) { if (!targetFile.IsFile()) { return(null); } var lines = targetFile.ReadAllLines() .Where(_ => !string.IsNullOrEmpty(_)); var result = lines .Select(_ => new FileSignature { Md5Hash = _.Substring(0, 32), Path = FsPathPersistence.Deserialize(_.Substring(33)).Intern(internPath) }).ToArray(); return(result); }
public FsPath Deserialize(IDeserializer context, ICfgNode cfgNode) { string path = context.Deserialize <string>(cfgNode); return(FsPathPersistence.Deserialize(path)); }