Exemplo n.º 1
0
        internal IAsyncResult SaveDataAsync(DataLoadedCallbackDelegate onSavedCallback)
        {
            var saver = new DataSaveDelegate(SaveData);
            var saved = new AsyncCallback(onSavedCallback);

            return(saver.BeginInvoke(saved, saver));
        }
Exemplo n.º 2
0
        internal IAsyncResult LoadDataAsync(DataLoadedCallbackDelegate onLoadedCallback, LoadFromSources loadFrom)
        {
            var loader = new DataLoadDelegate(LoadData);
            var loaded = new AsyncCallback(onLoadedCallback);

            switch (loadFrom)
            {
            case LoadFromSources.TryDataFileFirstThenServicesFile:
                return(loader.BeginInvoke(DataPersistor.LoadPortData, loaded, loader));

            case LoadFromSources.DataFile:
                return(loader.BeginInvoke(DataPersistor.LoadApplicationDataFromDataFile, loaded, loader));

            default:
                return(loader.BeginInvoke(DataPersistor.LoadApplicationDataFromServicesFile, loaded, loader));
            }
        }
Exemplo n.º 3
0
 internal IAsyncResult LoadDataAsync(DataLoadedCallbackDelegate onLoadedCallback)
 {
     return(LoadDataAsync(onLoadedCallback, LoadFromSources.TryDataFileFirstThenServicesFile));
 }