/// <summary>
		/// Initializes a new multipart instance.
		/// </summary>
		/// <remarks>This is an internal constructor and no checks are made about if the element
		/// belongs to the parent instance or not.</remarks>
		internal ElementInfo(ElementInfo parent, MemberInfo info)
			: this(info)
		{
			if (parent == null) throw new ArgumentNullException("parent", "Parent Info cannot be null.");
			if (parent.IsDisposed) throw new ObjectDisposedException(parent.ToString());
			_Parent = parent;
		}
		/// <summary>
		/// Invoked when disposing or finalizing this instance.
		/// </summary>
		/// <param name="disposing">True if the object is being disposed, false otherwise.</param>
		/// <param name="disposeParent">True to also dispose the parent instance, if any.</param>
		protected virtual void OnDispose(bool disposing, bool disposeParent)
		{
			if (disposing)
			{
				try
				{
					if (disposeParent && _Parent != null) _Parent.Dispose(true);
				}
				catch { }
			}

			_MemberInfo = null;
			_Parent = null;

			_IsDisposed = true;
		}
		/// <summary>
		/// Returns a new instance that is a copy of the original one.
		/// </summary>
		/// <returns>A new instance that is a copy of the original one.</returns>
		public ElementInfo Clone()
		{
			var cloned = new ElementInfo();
			OnClone(cloned); return cloned;
		}
Beispiel #4
0
        /// <summary>
        /// Returns a new instance that is a copy of the original one.
        /// </summary>
        /// <returns>A new instance that is a copy of the original one.</returns>
        public ElementInfo Clone()
        {
            var cloned = new ElementInfo();

            OnClone(cloned); return(cloned);
        }