Пример #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;
            }
        }
Пример #2
0
 public FileConflictObserver(AsyncFilesSession asyncFilesSession)
 {
     this.asyncFilesSession = asyncFilesSession;
 }
Пример #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;
            }
        }