1234567891011121314151617181920212223242526272829303132 |
- using System.IO;
- namespace TriLibCore.SFB
- {
-
- public class ItemWithStream
- {
-
- public string Name { get; set; }
-
- public Stream Stream { private get; set; }
-
-
-
- public bool HasData => !string.IsNullOrWhiteSpace(Name) || Stream != null;
-
-
-
-
- public Stream OpenStream()
- {
- if (Stream == null && Name != null)
- {
- return File.OpenRead(Name);
- }
- return Stream;
- }
- }
- }
|