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

					if (_Metadata != null) _Metadata.Clear();

					if (_EntryMetadata != null) _EntryMetadata._Entry = null;
					if (_EntryTags != null) _EntryTags._Entry = null;
				}
				catch { }
			}

			_Owner = null;
			_Metadata = null;
			_EntryMetadata = null;
			_EntryTags = null;

			_IsDisposed = true;
		}
Exemple #2
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 public SchemaEntry()
 {
     _EntryMetadata = new SchemaEntryMetadata()
     {
         _Entry = this
     };
     _EntryTags = new SchemaEntryTags()
     {
         _Entry = this
     };
 }
Exemple #3
0
        /// <summary>
        /// Protected initializer required for custom serialization.
        /// </summary>
        protected SchemaEntry(SerializationInfo info, StreamingContext context)
        {
            _EntryMetadata = new SchemaEntryMetadata()
            {
                _Entry = this
            };
            _EntryTags = new SchemaEntryTags()
            {
                _Entry = this
            };

            int count = (int)info.GetValue("MetaCount", typeof(int));

            for (int i = 0; i < count; i++)
            {
                string name  = info.GetString("MetaName" + i);
                string meta  = info.GetString("MetaType" + i);
                object value = null;

                if (meta == "RuntimeType")
                {
                    string temp = info.GetString("MetaValue" + i);
                    Type   type = Type.GetType(temp);
                    value = type;
                }
                else if (meta == "NULL")
                {
                    value = null;
                }
                else
                {
                    Type type = Type.GetType(meta);
                    value = info.GetValue("MetaValue" + i, type);
                }

                _Metadata[name] = value;
            }

            _TableNameTag            = info.GetString("TableNameTag");
            _ColumnNameTag           = info.GetString("ColumnNameTag");
            _IsPrimaryKeyColumnTag   = info.GetString("IsPrimaryKeyColumnTag");
            _IsUniqueValuedColumnTag = info.GetString("IsUniqueValuedColumnTag");
            _IsReadOnlyColumnTag     = info.GetString("_IsReadOnlyColumnTag");
        }
Exemple #4
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);
                        }
                    }

                    if (_Metadata != null)
                    {
                        _Metadata.Clear();
                    }

                    if (_EntryMetadata != null)
                    {
                        _EntryMetadata._Entry = null;
                    }
                    if (_EntryTags != null)
                    {
                        _EntryTags._Entry = null;
                    }
                }
                catch { }
            }

            _Owner         = null;
            _Metadata      = null;
            _EntryMetadata = null;
            _EntryTags     = null;

            _IsDisposed = true;
        }
		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		public SchemaEntry()
		{
			_EntryMetadata = new SchemaEntryMetadata() { _Entry = this };
			_EntryTags = new SchemaEntryTags() { _Entry = this };
		}
		/// <summary>
		/// Protected initializer required for custom serialization.
		/// </summary>
		protected SchemaEntry(SerializationInfo info, StreamingContext context)
		{
			_EntryMetadata = new SchemaEntryMetadata() { _Entry = this };
			_EntryTags = new SchemaEntryTags() { _Entry = this };

			int count = (int)info.GetValue("MetaCount", typeof(int));

			for (int i = 0; i < count; i++)
			{
				string name = info.GetString("MetaName" + i);
				string meta = info.GetString("MetaType" + i);
				object value = null;

				if (meta == "RuntimeType")
				{
					string temp = info.GetString("MetaValue" + i);
					Type type = Type.GetType(temp);
					value = type;
				}
				else if (meta == "NULL")
				{
					value = null;
				}
				else
				{
					Type type = Type.GetType(meta);
					value = info.GetValue("MetaValue" + i, type);
				}

				_Metadata[name] = value;
			}

			_TableNameTag = info.GetString("TableNameTag");
			_ColumnNameTag = info.GetString("ColumnNameTag");
			_IsPrimaryKeyColumnTag = info.GetString("IsPrimaryKeyColumnTag");
			_IsUniqueValuedColumnTag = info.GetString("IsUniqueValuedColumnTag");
			_IsReadOnlyColumnTag = info.GetString("_IsReadOnlyColumnTag");
		}