Esempio n. 1
0
        /// <summary>
        /// Enumerate triggers info
        /// </summary>
        /// <param name="tableName">Table name</param>
        /// <returns>Triggers info list</returns>
        public VDBTriggerInfo[] EnumTriggers(string tableName)
        {
            int triggersCount, position;

            VDBTriggerInfo[] triggers;

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

            position = this.position;

            try
            {
                FindTriggerSection();
                GetInteger();
                triggersCount = GetInteger();
                triggers      = new VDBTriggerInfo[triggersCount];

                for (int i = 0; i < triggersCount; i++)
                {
                    triggers[i].Name        = GetString();
                    triggers[i].Body        = GetString();
                    triggers[i].Event       = (VDBTriggerEvent)GetInteger();
                    triggers[i].Priority    = GetInteger();
                    triggers[i].Active      = GetBool();
                    triggers[i].Description = GetString();
                }
            }
            finally
            {
                this.position = position;
            }

            return(triggers);
        }
		/// <summary>
		/// Enumerate triggers info
		/// </summary>
		/// <param name="tableName">Table name</param>
		/// <returns>Triggers info list</returns>
		public VDBTriggerInfo[] EnumTriggers(string tableName)
		{
			int triggersCount, position;
			VDBTriggerInfo[] triggers;

			if(!FindTable(tableName))
				return null;

			position = this.position;

			try
			{
				FindTriggerSection();
				GetInteger();
				triggersCount = GetInteger();
				triggers      = new VDBTriggerInfo[triggersCount];

				for(int i = 0; i < triggersCount; i++)
				{
					triggers[i].Name        = GetString();
					triggers[i].Body        = GetString();
					triggers[i].Event       = (VDBTriggerEvent)GetInteger();
					triggers[i].Priority    = GetInteger();
					triggers[i].Active      = GetBool();
					triggers[i].Description = GetString();
				}
			}
			finally
			{
				this.position = position;
			}

			return triggers;
		}