//===============================================================================
// Microsoft patterns & practices
// Web Service Software Factory
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

#region Using Statements
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
//using Microsoft.Practices.ServiceFactory.DataAccess.Converters;
using Microsoft.Practices.RecipeFramework.Extensions.Converters;
#endregion

namespace Howest.Guidance.DataAccess.CodeGeneration.ObjectModel
{
    /// <summary/>
    public class Property
    {
        #region Property properties
        private string name;

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [TypeConverter(typeof(CSharpIdentifierConverter))]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private bool isNullable;

        /// <summary>
        /// Gets or sets a value indicating whether this instance is nullable.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is nullable; otherwise, <c>false</c>.
        /// </value>
        [ReadOnly(true)]
        public bool IsNullable
        {
            get { return isNullable; }
            set { isNullable = value; }
        }

        private Type type;

        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>The type.</value>
        [ReadOnly(true)]
        public Type Type
        {
            get { return type; }
            set { type = value; }
        }
        #endregion

        #region TableMappings
        private string columnName;
        /// <summary>
        /// Gets or sets the name of the column.
        /// </summary>
        /// <value>The name of the column.</value>
        [Browsable(false)]
        public string ColumnName
        {
            get { return columnName; }
            set { columnName = value; }
        }

        private bool isPrimaryKey = false;

        /// <summary>
        /// Gets or sets a value indicating whether this instance is primary key.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is primary key; otherwise, <c>false</c>.
        /// </value>

        [Browsable(false)]
        public bool IsPrimaryKey
        {
            get { return isPrimaryKey; }
            set { isPrimaryKey = value; }
        }

        private bool readOnly = false;

        public bool ReadOnly
        {
            get { return readOnly; }
            set { readOnly = value; }
        }
        #endregion
    }
}
