소스 검색

Reusing CheckNotOpened

(cherry picked from commit f614f7915c1bb2c2fe08297b0885515884adb5e8)

Source commit: 42cff43bac8bb3221e4c23809abd71c2c97726cb
Martin Prikryl 4 년 전
부모
커밋
3cfae3d1fd
1개의 변경된 파일2개의 추가작업 그리고 12개의 파일을 삭제
  1. 2 12
      dotnet/Session.cs

+ 2 - 12
dotnet/Session.cs

@@ -238,12 +238,7 @@ namespace WinSCP
         {
             using (CreateCallstackAndLock())
             {
-                CheckNotDisposed();
-
-                if (Opened)
-                {
-                    throw Logger.WriteException(new InvalidOperationException("Session is already opened"));
-                }
+                CheckNotOpened();
 
                 if (sessionOptions == null)
                 {
@@ -423,12 +418,7 @@ namespace WinSCP
 
                 string result;
 
-                CheckNotDisposed();
-
-                if (Opened)
-                {
-                    throw Logger.WriteException(new InvalidOperationException("Session is already opened"));
-                }
+                CheckNotOpened();
 
                 try
                 {