Пример #1
0
            public ConnectClass Close()
            {
                if (!IsOpen)
                {
                    throw new InvalidOperationException("All Connection is already closed.");
                }

                CellConnection.Close();
                RowConnection.Close();
                SheetConnection.Close();
                Connection.Close();

                return(this);
            }
Пример #2
0
 public void Dispose()
 {
     if (CellConnection != null && CellConnection.State.HasFlag(ConnectionState.Open))
     {
         CellConnection.Close();
     }
     if (RowConnection != null && RowConnection.State.HasFlag(ConnectionState.Open))
     {
         RowConnection.Close();
     }
     if (SheetConnection != null && SheetConnection.State.HasFlag(ConnectionState.Open))
     {
         SheetConnection.Close();
     }
     if (Connection != null && Connection.State.HasFlag(ConnectionState.Open))
     {
         Connection.Close();
     }
 }