//.################################################
//# Copyright © 2006-2010 Evolving Software Ltd   #
//# Author: Vijay Patel                           #
//################################################'

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

using Evolving.DomainTypes;
using Evolving.TrueView.Domain.Attributes;

namespace TestApplicationDomainModel.BasicTypes
{
    /// <summary>
    /// A set of Text(string) properties
    /// </summary>
    [Serializable]
    [ObjectInstance(IsPersistable = false)]
    public class TextValues : EntityBase
    {


        private string _TextValue = string.Empty;

        /// <summary>
        /// This is a normal Char.  It shouldn't allow more than 1 character to be entered.
        /// </summary>
        public char NormalChar { get; set; }

        /// <summary>
        /// This is a normal Text
        /// </summary>
        public string NormalText
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a Text with a public Getter, but a hidden Setter.
        /// </summary>
        public string ReadOnlyText
        {
            get { return _TextValue; }
            internal set { _TextValue = value; }
        }

        /// <summary>
        /// This is a Text with a hidden Getter, but a public Setter.
        /// This should not be visible in the UI.
        /// </summary>
        public string WriteOnlyText
        {
            internal get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a public Text, but should be hidden in the UI.
        /// </summary>
        [Text(IsVisible = false)]
        public string HiddenText
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a multi-line Text. Use CTRL-ENTER to add new lines.
        /// </summary>
        [Text(IsMultiLine = true)]
        public string MultiLineText
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a Rich Text Text. Use CTRL-ENTER to add new lines.
        /// </summary>
        [Text(IsRichText = true)]
        public string RichTextText
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a password string, and should be shown using asterisks
        /// </summary>
        [Text(IsPassword = true)]
        public string PasswordText
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a Text that cannot exceed 16 characters
        /// </summary>
        [Text(MaxLength = 16)]
        public string TextWithMaximumSize
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This is a Text that must be between 8 and 16 characters in length
        /// </summary>
        [Text(MinLength = 8, MaxLength = 16)]
        internal string TextWithSize
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

        /// <summary>
        /// This will force the string to be shown using a pre-defined format
        /// </summary>
        [Text(EditMask = "(###)##-##-####")]
        public string EditMaskText
        {
            get { return _TextValue; }
            set { _TextValue = value; }
        }

    }
}
