예제 #1
0
            async Task <SteamSession> Start <T>(uint appId, IAbsoluteDirectoryPath steamPath,
                                                Func <IScheduler, Task <T> > initializer, Action simulate)
            {
                var session = new SteamSession(steamPath);
                await session.Initialize(appId, initializer, simulate).ConfigureAwait(false);

                Session = session;
                return(session);
            }
예제 #2
0
 public async Task <T> Do <T, TInit>(uint appId, IAbsoluteDirectoryPath steamPath,
                                     Func <IScheduler, Task <TInit> > initializer, Action simulate, Func <TInit, Task <T> > action) where TInit : IDisposable
 {
     using (var session = new SteamSession(steamPath)) {
         using (var api = await session.Initialize(appId, initializer, simulate).ConfigureAwait(false)) {
             Session = session;
             return(await session.Do(() => action(api)).ConfigureAwait(false));
         }
     }
 }