Beispiel #1
0
 /// <summary>
 /// 释放占用的资源。
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     if (_disposed)
     {
         return;
     }
     if (_vars != null)
     {
         _vars.Clear();
         _vars = null;
     }
     if (_dataContext != null)
     {
         _dataContext.Dispose();
         _dataContext = null;
     }
     _databaseName = null;
     if (_log != null)
     {
         _log.Dispose();
         _log = null;
     }
     GC.SuppressFinalize(this);
     _disposed = true;
 }
Beispiel #2
0
 /// <summary>
 /// 创建DatabaseSchemaContext实例。
 /// </summary>
 /// <param name="dataContext">DataContext对象</param>
 public DatabaseSchemaContext(Symbol.Data.IDataContext dataContext)
 {
     _dataContext  = dataContext;
     _databaseName = dataContext.Connection.Database;
     _log          = LogBase.Empty;
     _vars         = new Symbol.Collections.Generic.NameValueCollection <object>();
     _vars.Add("log", _log);
     _vars.Add("dataContext", _dataContext);
     _vars.Add("databaseName", _databaseName);
 }