Click here to Skip to main content
15,893,668 members
Articles / Programming Languages / C#

Use Rules In Your Applications

Rate me:
Please Sign up or sign in to vote.
4.84/5 (19 votes)
29 Aug 2006CPOL2 min read 112.4K   2.7K   93  
A Rules Engine class library with source code and documentation
//===============================================================================
// Jaxlab Rules Engine - A library for utilizing Rules in .Net
// Copyright (C) 2005  Jeff Bramlett - www.jaxlab.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//================================================================================
using System;

namespace Jaxlab.Rules
{
	/// <summary>
	/// Exception class used when an Inference is being added but the Inference 
	/// already exists.
	/// </summary>
	public class DuplicateInferenceException: System.Exception
	{
		#region Instance Data members
		/// <summary>
		/// The id of the variable
		/// </summary>
		string m_sVariableID = "";
		#endregion

		#region Ctors
		/// <summary>
		/// Parameterless constructor
		/// </summary>
		public DuplicateInferenceException()
		{
		}

		/// <summary>
		/// Default constructor
		/// </summary>
		/// <param name="sVarId"></param>
		public DuplicateInferenceException(string sVarId)
		{
			m_sVariableID = sVarId;
		}
		#endregion

		#region Overrides
		/// <summary>
		/// Override of Exception Message
		/// </summary>
		public override string Message
		{
			get
			{
				if(m_sVariableID == "")
				{
					return "Duplicate Variable ID for Inference";
				}
				else
				{
					return "Duplicate Variable ID " + m_sVariableID + " for Inference";
				}
			}
		}
		#endregion

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Website: http://www.somedeveloper.us

Comments and Discussions