Esempio n. 1
0
 public Tilesheet(EngineResourceFile resFile, string entryName)
 {
     ResourceIdentifier = new EngineResourceFileIdentifier(resFile, EngineResourceFileTypes.Bitmap, entryName);
     InitVals(entryName, null, null, ResourceIdentifier);
     ValueBag = new Dictionary<string, string>();
 }
Esempio n. 2
0
 private void OnSerializing(StreamingContext context)
 {
     // if Bitmap is not a physical file and there is no ResourceFile, create resource file so it can be serialized
     if (string.IsNullOrWhiteSpace(_imgFile) && ResourceIdentifier == null)
     {
         var resFile = new EngineResourceFile(string.Format("tilesheet_{0}.zip", this.Name), null, false);
         var converter = new ImageConverter();
         resFile.Add(EngineResourceFileTypes.Bitmap, this.Name, (Stream)converter.ConvertTo(_bmp, typeof(Stream)));
         ResourceIdentifier = new EngineResourceFileIdentifier(resFile, EngineResourceFileTypes.Bitmap, this.Name);
     }
 }
Esempio n. 3
0
 public ResourceFile(EngineResourceFile engineResourceFile)
 {
     InitializeComponent();
     _engineResourceFile = engineResourceFile;
     UpdateLabels();
 }
Esempio n. 4
0
 private void OnSerializing(StreamingContext context)
 {
     // if IsTempFile but no ResourceFile, create resource file so it can be serialized
     if (IsTempFile && ResourceIdentifier == null)
     {
         var resFile = new EngineResourceFile(string.Format("mediafile_{0}.zip", FileName), null, false);
         resFile.Add(ResourceFileType, Alias, InputStream);
         ResourceIdentifier = new EngineResourceFileIdentifier(resFile, ResourceFileType, Alias);
     }
 }
 public EngineResourceFileIdentifier(EngineResourceFile resFile, EngineResourceFileTypes resType, string entry)
 {
     ResourceFile = resFile;
     ResourceType = resType;
     ResourceName = entry;
 }
 public EngineResourceFileIdentifier(EngineResourceFile resFile, EngineResourceFileTypes resType, string entry)
 {
     ResourceFile = resFile;
     ResourceType = resType;
     ResourceName = entry;
 }