コード例 #1
0
ファイル: Schema.cs プロジェクト: sndnvaps/Kerosene.ORM
        /// <summary>
        /// Invoked when disposing or finalizing this instance.
        /// </summary>
        /// <param name="disposing">True if the object is being disposed, false otherwise.</param>
        protected virtual void OnDispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (_Members != null)
                    {
                        var list = _Members.ToArray();
                        foreach (var member in list)
                        {
                            member.Dispose();
                        }
                        Array.Clear(list, 0, list.Length);
                    }

                    if (_Aliases != null && !_Aliases.IsDisposed)
                    {
                        _Aliases.Dispose();
                    }
                }
                catch { }
            }

            _Members = null;
            _Aliases = null;

            _IsDisposed = true;
        }
コード例 #2
0
		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// <param name="link">The link this instance will be associated with.</param>
		public QueryCommand(IDataLink link)
			: base(link)
		{
			if ((_Aliases = Link.Engine.CreateElementAliasCollection()) == null)
				throw new CannotCreateException(
					"Cannot create a collection of aliases for this instance.");
		}
コード例 #3
0
ファイル: Schema.cs プロジェクト: JackWangCUMT/Kerosene.ORM
		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// <param name="caseSensitiveNames">Whether the table and column names in this collection
		/// are case sensitive or not.</param>
		public Schema(
			bool caseSensitiveNames = Core.Schema.DEFAULT_CASESENSITIVE_NAMES)
		{
			_CaseSensitiveNames = caseSensitiveNames;
			if ((_Aliases = CreateAliasCollection()) == null)
				throw new CannotCreateException("Cannot create a collection of aliases.");

			_Members = new EntryList(caseSensitiveNames);
		}
コード例 #4
0
ファイル: Schema.cs プロジェクト: sndnvaps/Kerosene.ORM
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="caseSensitiveNames">Whether the table and column names in this collection
        /// are case sensitive or not.</param>
        public Schema(
            bool caseSensitiveNames = Core.Schema.DEFAULT_CASESENSITIVE_NAMES)
        {
            _CaseSensitiveNames = caseSensitiveNames;
            if ((_Aliases = CreateAliasCollection()) == null)
            {
                throw new CannotCreateException("Cannot create a collection of aliases.");
            }

            _Members = new EntryList(caseSensitiveNames);
        }
コード例 #5
0
		/// <summary>
		/// Invoked when disposing or finalizing this instance.
		/// </summary>
		/// <param name="disposing">True if the object is being disposed, false otherwise.</param>
		protected override void OnDispose(bool disposing)
		{
			if (disposing)
			{
				try { if (_Aliases != null && !_Aliases.IsDisposed) _Aliases.Dispose(); }
				catch { }
			}
			_Aliases = null;

			base.OnDispose(disposing);
		}
コード例 #6
0
ファイル: Schema.cs プロジェクト: sndnvaps/Kerosene.ORM
        /// <summary>
        /// Protected initializer required for custom serialization.
        /// </summary>
        protected Schema(SerializationInfo info, StreamingContext context)
        {
            _CaseSensitiveNames = info.GetBoolean("CaseSensitiveNames");
            _Aliases            = info.GetExtended <IElementAliasCollection>("Aliases");

            _Members = new EntryList(_CaseSensitiveNames);
            int count = (int)info.GetValue("MembersCount", typeof(int));

            for (int i = 0; i < count; i++)
            {
                var member = info.GetExtended <ISchemaEntry>("Member" + i);
                _Members.Add(member);
            }
        }
コード例 #7
0
		/// <summary>
		/// Invoked when disposing or finalizing this instance.
		/// </summary>
		/// <param name="disposing">True if the object is being disposed, false otherwise.</param>
		protected virtual void OnDispose(bool disposing)
		{
			if (disposing)
			{
				try
				{
					if (_Owner != null)
					{
						var temp = _Owner; _Owner = null;
						if (temp != null && !temp.IsDisposed) temp.Remove(this);
					}
				}
				catch { }
			}

			_Owner = null;

			_IsDisposed = true;
		}
コード例 #8
0
ファイル: ElementAlias.cs プロジェクト: sndnvaps/Kerosene.ORM
        /// <summary>
        /// Invoked when disposing or finalizing this instance.
        /// </summary>
        /// <param name="disposing">True if the object is being disposed, false otherwise.</param>
        protected virtual void OnDispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (_Owner != null)
                    {
                        var temp = _Owner; _Owner = null;
                        if (temp != null && !temp.IsDisposed)
                        {
                            temp.Remove(this);
                        }
                    }
                }
                catch { }
            }

            _Owner = null;

            _IsDisposed = true;
        }
コード例 #9
0
ファイル: Schema.cs プロジェクト: JackWangCUMT/Kerosene.ORM
		/// <summary>
		/// Invoked when disposing or finalizing this instance.
		/// </summary>
		/// <param name="disposing">True if the object is being disposed, false otherwise.</param>
		protected virtual void OnDispose(bool disposing)
		{
			if (disposing)
			{
				try
				{
					if (_Members != null)
					{
						var list = _Members.ToArray();
						foreach (var member in list) member.Dispose();
						Array.Clear(list, 0, list.Length);
					}

					if (_Aliases != null && !_Aliases.IsDisposed) _Aliases.Dispose();
				}
				catch { }
			}

			_Members = null;
			_Aliases = null;

			_IsDisposed = true;
		}
コード例 #10
0
 /// <summary>
 /// Returns true if this object can be considered as equivalent to the target one given.
 /// </summary>
 /// <param name="target">The target object this one will be tested for equivalence.</param>
 /// <returns>True if this object can be considered as equivalent to the target one given.</returns>
 public bool EquivalentTo(IElementAliasCollection target)
 {
     return(OnEquivalentTo(target));
 }
コード例 #11
0
		/// <summary>
		/// Returns true if this object can be considered as equivalent to the target one given.
		/// </summary>
		/// <param name="target">The target object this one will be tested for equivalence.</param>
		/// <returns>True if this object can be considered as equivalent to the target one given.</returns>
		public bool EquivalentTo(IElementAliasCollection target)
		{
			return OnEquivalentTo(target);
		}
コード例 #12
0
ファイル: Schema.cs プロジェクト: JackWangCUMT/Kerosene.ORM
		/// <summary>
		/// Protected initializer required for custom serialization.
		/// </summary>
		protected Schema(SerializationInfo info, StreamingContext context)
		{
			_CaseSensitiveNames = info.GetBoolean("CaseSensitiveNames");
			_Aliases = info.GetExtended<IElementAliasCollection>("Aliases");

			_Members = new EntryList(_CaseSensitiveNames);
			int count = (int)info.GetValue("MembersCount", typeof(int));
			for (int i = 0; i < count; i++)
			{
				var member = info.GetExtended<ISchemaEntry>("Member" + i);
				_Members.Add(member);
			}
		}