Provides data for a save or restore event.
Inheritance: System.EventArgs
Exemple #1
0
 private void vm_SaveRequested(object sender, SaveRestoreEventArgs e)
 {
     saveStream = new MemoryStream();
     e.Stream = saveStream;
 }
Exemple #2
0
 private void vm_LoadRequested(object sender, SaveRestoreEventArgs e)
 {
     e.Stream = saveFileData;
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }