private void vm_SaveRequested(object sender, SaveRestoreEventArgs e) { saveStream = new MemoryStream(); e.Stream = saveStream; }
private void vm_LoadRequested(object sender, SaveRestoreEventArgs e) { e.Stream = saveFileData; }
private void op_save(uint[] args) { if (nestingLevel == 0 && SaveRequested != null) { SaveRestoreEventArgs e = new SaveRestoreEventArgs(); SaveRequested(this, e); if (e.Stream != null) { try { SaveToStream(e.Stream, args[1], args[2]); } finally { e.Stream.Dispose();//.Close(); } PerformDelayedStore(args[1], args[2], 0); return; } } // failed PerformDelayedStore(args[1], args[2], 1); }
private void op_restore(uint[] args) { if (LoadRequested != null) { SaveRestoreEventArgs e = new SaveRestoreEventArgs(); LoadRequested(this, e); if (e.Stream != null) { try { LoadFromStream(e.Stream); } finally { e.Stream.Dispose();//.Close(); } return; } } // failed PerformDelayedStore(args[1], args[2], 1); }
private async void op_restore(uint[] args) { if (LoadRequested != null) { SaveRestoreEventArgs e = new SaveRestoreEventArgs(); LoadRequested(this, e); if (e.Stream != null) { LoadFromStream(e.Stream); await e.Stream.FlushAsync(); e.Stream.Dispose(); return; } } // failed PerformDelayedStore(args[1], args[2], 1); }
private async void op_save(uint[] args) { if (nestingLevel == 0 && SaveRequested != null) { SaveRestoreEventArgs e = new SaveRestoreEventArgs(); SaveRequested(this, e); if (e.Stream != null) { SaveToStream(e.Stream, args[1], args[2]); await e.Stream.FlushAsync(); e.Stream.Dispose(); PerformDelayedStore(args[1], args[2], 0); return; } } // failed PerformDelayedStore(args[1], args[2], 1); }