using System;

namespace TheBox.BoxServer
{
	[ Serializable ]
	/// <summary>
	/// Signals the generic success of an action
	/// </summary>
	public class GenericOK : BoxMessage
	{
		/// <summary>
		/// Creates a new GenericOK message
		/// </summary>
		public GenericOK()
		{
		}
	}

	[ Serializable ]
	/// <summary>
	/// Generic error message generated by the BoxServer
	/// </summary>
	public class ErrorMessage : BoxMessage
	{
		private string m_Message;

		/// <summary>
		/// Gets the message describing the error
		/// </summary>
		public string Message
		{
			set { m_Message = value; }
			get { return m_Message; }
		}

		/// <summary>
		/// Creates a new ErrorMessage
		/// </summary>
		/// <param name="message">The message describing the error</param>
		public ErrorMessage( string message )
		{
			m_Message = message;
		}

		/// <summary>
		/// Creates a new ErrorMessage
		/// </summary>
		/// <param name="message">The format string for the message</param>
		/// <param name="args">The arguments for the format</param>
		public ErrorMessage( string message, params string[] args )
		{
			m_Message = string.Format( message, args );
		}

		/// <summary>
		/// Creates a new ErrorMessage
		/// </summary>
		public ErrorMessage()
		{
		}
	}

	[ Serializable ]
	/// <summary>
	/// BoxServer login error message
	/// </summary>
	public class LoginError : BoxMessage
	{
		private AuthenticationResult m_Error;

		/// <summary>
		/// The type of authentication error
		/// </summary>
		public AuthenticationResult Error
		{
			set { m_Error = value; }
			get { return m_Error; }
		}

		/// <summary>
		/// Creates a new LoginError message
		/// </summary>
		/// <param name="error">The login error</param>
		public LoginError ( AuthenticationResult error )
		{
			m_Error = error;
		}

		/// <summary>
		/// Creates a new LoginError message
		/// </summary>
		public LoginError()
		{
		}
	}

	/// <summary>
	/// BoxServer doesn't have a requested feature installed
	/// </summary>
	public class FeatureNotSupported : BoxMessage
	{
		/// <summary>
		/// Creates a new FeatureNotSupported message
		/// </summary>
		public FeatureNotSupported()
		{
		}
	}

	/// <summary>
	/// A requested datafile hasn't been yet generated
	/// </summary>
	public class DatafileNotFound : BoxMessage
	{
		/// <summary>
		/// Creates a new DatafileNotFound message
		/// </summary>
		public DatafileNotFound()
		{
		}
	}
}
