예제 #1
0
        /// <summary>
        /// Enumerate constraints info
        /// </summary>
        /// <param name="tableName">Table name</param>
        /// <returns>Constraints info list</returns>
        public VDBConstraintInfo[] EnumConstraints(string tableName)
        {
            int constraintsCount, position;

            VDBConstraintInfo[] constraints;

            if (!FindTable(tableName))
            {
                return(null);
            }

            position = this.position;

            try
            {
                FindConstraintSection();
                GetInteger();
                constraintsCount = GetInteger();
                constraints      = new VDBConstraintInfo[constraintsCount];

                for (int i = 0; i < constraintsCount; i++)
                {
                    constraints[i].Name        = GetString();
                    constraints[i].Active      = GetBool();
                    constraints[i].Description = GetString();
                    constraints[i].Body        = GetString();
                }
            }
            finally
            {
                this.position = position;
            }

            return(constraints);
        }
예제 #2
0
		/// <summary>
		/// Enumerate constraints info
		/// </summary>
		/// <param name="tableName">Table name</param>
		/// <returns>Constraints info list</returns>
		public VDBConstraintInfo[] EnumConstraints(string tableName)
		{
			int constraintsCount, position;
			VDBConstraintInfo[] constraints;

			if(!FindTable(tableName))
				return null;

			position = this.position;

			try
			{
				FindConstraintSection();
				GetInteger();
				constraintsCount = GetInteger();
				constraints = new VDBConstraintInfo[constraintsCount];

				for(int i = 0; i < constraintsCount; i++)
				{
					constraints[i].Name        = GetString();
					constraints[i].Active      = GetBool();
					constraints[i].Description = GetString();
					constraints[i].Body        = GetString();
				}
			}
			finally
			{
				this.position = position;
			}

			return constraints;
		}