Exemplo n.º 1
0
        public IAsyncFilesSession OpenAsyncSession(OpenFilesSessionOptions sessionOptions)
        {
            AssertInitialized();
            EnsureNotClosed();

            if (string.IsNullOrWhiteSpace(sessionOptions.FileSystem))
            {
                throw new ArgumentException("Filesystem cannot be null, empty or whitespace.", "FileSystem");
            }


            var sessionId = Guid.NewGuid();

            currentSessionId = sessionId;
            try
            {
                var client  = SetupCommandsAsync(this.AsyncFilesCommands, sessionOptions);
                var session = new AsyncFilesSession(this, client, this.Listeners, sessionId);
                AfterSessionCreated(session);
                return(session);
            }
            finally
            {
                currentSessionId = null;
            }
        }
Exemplo n.º 2
0
 public FileConflictObserver(AsyncFilesSession asyncFilesSession)
 {
     this.asyncFilesSession = asyncFilesSession;
 }
Exemplo n.º 3
0
        public IAsyncFilesSession OpenAsyncSession(OpenFilesSessionOptions sessionOptions)
        {
            AssertInitialized();
            EnsureNotClosed();

            if (string.IsNullOrWhiteSpace(sessionOptions.FileSystem))
                throw new ArgumentException("Filesystem cannot be null, empty or whitespace.", "FileSystem");


            var sessionId = Guid.NewGuid();
            currentSessionId = sessionId;
            try
            {
	            var client = SetupCommandsAsync(this.AsyncFilesCommands, sessionOptions);
                var session = new AsyncFilesSession(this, client, this.Listeners, sessionId);
                AfterSessionCreated(session);
                return session;
            }
            finally
            {
                currentSessionId = null;
            }
        }