I have been trying to find a solution to this for a few hours now and my Google foo is not doing the job.
I have a map editor, with a bunch of tiles. I want to serialize the entire Map class to a file for later loading, I can't for the love of me figure out how to get what every tutorial/blog/stackoverflow answer is talking about, the StorageDevice/StorageContainer.
Am I missing something here?
Even the code samples gave to me by my tutor asks for the StorageContainer:
public static void SaveHighScores(HighScoreData data, string filename)
{
// Get the path of the save game
string fullpath = Path.Combine(StorageContainer.TitleLocation, filename);
// Open the file, creating it if necessary
FileStream stream = File.Open(fullpath, FileMode.OpenOrCreate);
try
{
// Convert the object to XML data and put it in the stream
XmlSerializer serializer = new XmlSerializer(typeof(HighScoreData));
serializer.Serialize(stream, data);
}
finally
{
// Close the file
stream.Close();
}
}
Where does File.Open start? Is it the root directory of the machine (User)?