Esempio n. 1
0
		// Not implementing finalizer here because there are no unmanaged resources
		// to release. See http://msdnwiki.microsoft.com/en-us/mtpswiki/12afb1ea-3a17-4a3f-a1f0-fcdb853e2359.aspx

		// The bulk of the clean-up code is implemented in Dispose(bool)
		protected virtual void Dispose(bool disposing)
		{
			// Implemented but empty so that derived contexts can implement
			// a finalizer that potentially cleans up unmanaged resources.
			if(disposing)
			{
				_services = null;
				if(_conManager != null)
				{
					_conManager.DisposeConnection();
				}
				_conManager = null;
				_typeProvider = null;
				_sqlFactory = null;
				_translator = null;
				_readerCompiler = null;
				_log = null;
			}
		}
Esempio n. 2
0
 internal Visitor(SqlFactory sql)
 {
     this.sql = sql;
 }
Esempio n. 3
0
		private void InitializeProviderMode()
		{
			if(_typeProvider == null)
			{
				switch(_mode)
				{
					case SqlServerProviderMode.Sql2000:
						_typeProvider = SqlTypeSystem.Create2000Provider();
						break;
					case SqlServerProviderMode.Sql2005:
						_typeProvider = SqlTypeSystem.Create2005Provider();
						break;
					case SqlServerProviderMode.Sql2008:
						_typeProvider = SqlTypeSystem.Create2008Provider();
						break;
					case SqlServerProviderMode.SqlCE:
						_typeProvider = SqlTypeSystem.CreateCEProvider();
						break;
					default:
						System.Diagnostics.Debug.Assert(false);
						break;
				}
			}
			if(_sqlFactory == null)
			{
				_sqlFactory = new SqlFactory(_typeProvider, _services.Model);
				_translator = new Translator(_services, _sqlFactory, _typeProvider);
			}
		}
Esempio n. 4
0
 internal LongTypeConverter(SqlFactory sql)
 {
     this.visitor = new Visitor(sql);
 }
			internal Visitor(SqlFactory sql)
			{
				this.sql = sql;
			}
		internal LongTypeConverter(SqlFactory sql)
		{
			this.visitor = new Visitor(sql);
		}
			internal Visitor(SqlFactory sql, SqlServerProviderMode providerMode)
			{
				this.sql = sql;
				this.providerMode = providerMode;
				this.skipper = new SqlSelectionSkipper(this);
			}
		internal static SqlNode Convert(SqlNode node, SqlFactory nodeFactory, SqlServerProviderMode providerMode)
		{
			return new Visitor(nodeFactory, providerMode).Visit(node);
		}