Explorar o código

Reusing CheckNotOpened

(cherry picked from commit f614f7915c1bb2c2fe08297b0885515884adb5e8)

Source commit: 42cff43bac8bb3221e4c23809abd71c2c97726cb
Martin Prikryl %!s(int64=4) %!d(string=hai) anos
pai
achega
3cfae3d1fd
Modificáronse 1 ficheiros con 2 adicións e 12 borrados
  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
                 {