Fix resource import interrupted when item not valid.
This commit is contained in:
@@ -12,6 +12,10 @@ namespace Cryville.Crtr.Browsing {
|
||||
Name = StringUtils.EscapeFileName(name);
|
||||
}
|
||||
public string Name { get; private set; }
|
||||
public abstract bool Valid { get; }
|
||||
public override string ToString() {
|
||||
return string.Format("{0} ({1})", Name, ReflectionHelper.GetSimpleName(GetType()));
|
||||
}
|
||||
}
|
||||
public class ChartResource : Resource {
|
||||
public ChartResource(string name, Chart main, ChartMeta meta) : base(name) {
|
||||
@@ -19,17 +23,20 @@ namespace Cryville.Crtr.Browsing {
|
||||
}
|
||||
public Chart Main { get; private set; }
|
||||
public ChartMeta Meta { get; private set; }
|
||||
public override bool Valid { get { return true; } }
|
||||
}
|
||||
public class CoverResource : Resource {
|
||||
public CoverResource(string name, FileInfo src) : base(name) {
|
||||
Source = src;
|
||||
}
|
||||
public FileInfo Source { get; private set; }
|
||||
public override bool Valid { get { return Source.Exists; } }
|
||||
}
|
||||
public class SongResource : Resource {
|
||||
public SongResource(string name, FileInfo src) : base(name) {
|
||||
Source = src;
|
||||
}
|
||||
public FileInfo Source { get; private set; }
|
||||
public override bool Valid { get { return Source.Exists; } }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user