/// <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; }
/// <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."); }
/// <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); }
/// <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); }
/// <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); }
/// <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); } }
/// <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; }
/// <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; }
/// <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; }
/// <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)); }
/// <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); }
/// <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); } }