initial saving working (possibly)

This commit is contained in:
2017-09-16 08:23:47 -05:00
parent 4f2d190b6c
commit e9f1a9a3ed
4 changed files with 22 additions and 9 deletions

View File

@ -22,12 +22,13 @@ namespace SpriteLibrary
ResourceManager myResources = null;
List<SpriteInfo> SpriteInformation = new List<SpriteInfo>();
Size SnapGridSize = new Size(5,5);
SpriteDatabase myDatabase = null;
internal SpriteEntryForm(ResourceManager theResourceManager, List<SpriteInfo> ListToWorkOn, Size GridSize)
internal SpriteEntryForm(SpriteDatabase theDatabase, List<SpriteInfo> ListToWorkOn, Size GridSize)
{
InitializeComponent();
if (theResourceManager == null) throw new Exception("NullException: The ResourceManager passed to the SpriteEntryForm cannot be null. Pass it Properties.Resources.ResourceManager");
myResources = theResourceManager;
myDatabase = theDatabase;
myResources = myDatabase.GetResourceManager();
SnapGridSize = GridSize;
LocalSetup();
SpriteInformation.AddRange(ListToWorkOn);
@ -87,5 +88,10 @@ namespace SpriteLibrary
}
}
}
private void SpriteEntryForm_FormClosing(object sender, FormClosingEventArgs e)
{
myDatabase.Save(); //try saving the file
}
}
}