//.################################################
//# 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;
using System.Drawing;

namespace TestApplicationDomainModel.BasicTypes
{
    /// <summary>
    /// A set of Struct properties
    /// </summary>
    [Serializable]
    [ObjectInstance(IsPersistable = false)]
    public class StructValues
    {

        public StructValues()
        {
            this.ArrayOfNumbers = new int[] { 1, 2, 3, 5, 7, 11, 13 };

            this.ArrayOfColours = new Color[] { Color.Red, Color.Yellow, Color.Pink, Color.Green, Color.Purple, Color.Orange, Color.Blue };
        }

        public Guid ID { get; internal set; }

        /// <summary>
        /// This property will not be visible, because it isn't a Value type
        /// </summary>
        public Font Font { get; set; }

        /// <summary>
        /// This will show a PropertyGrid with X/Y values.
        /// The background colour should change when the control gets focus
        /// </summary>
        public Point Point { get; set; }

        private Rectangle _Rectangle;

        /// <summary>
        /// This will show a PropertyGrid with X/Y values.
        /// The Point value will change too, to show that associated properties are updated
        /// </summary>
        public Rectangle Rectangle
        {
            get { return _Rectangle; }
            set
            {
                _Rectangle = value;
                this.Point = new Point(this.Point.X + 1, this.Point.Y + 1);
            }
        }

        /// <summary>
        /// This will show a PropertyGrid with a colour selector
        /// </summary>
        public Color Colour { get; set; }

        /// <summary>
        /// This will show a PropertyGrid, but the value cannot be changed
        /// </summary>
        public Color ReadOnlyColour
        {
            get { return this.Colour; }
        }

        public int[] ArrayOfNumbers { get; set; }

        public Color[] ArrayOfColours { get; set; }

    }
}
