Horizon – Rev 1

Subversion Repositories:
Rev:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;

namespace Horizon.Snapshots
{
    public class Snapshot
    {
        #region Private Delegates, Events, Enums, Properties, Indexers and Fields

        private DateTime _time;

        #endregion

        #region Public Enums, Properties and Fields

        [DefaultValue(typeof(Color), "Empty")]
        public Color Color { get; set; }

        public string Name { get; set; }

        public string Path { get; set; }

        public string Time
        {
            get => _time.ToString(CultureInfo.InvariantCulture);
            set
            {
                if (DateTime.TryParse(value, out var dateTime))
                {
                    _time = dateTime;
                }
            }
        }

        public Bitmap Shot { get; set; }

        public string Hash { get; set; }

        #endregion

        #region Constructors, Destructors and Finalizers

        public Snapshot(string name, string path, string time, string hash)
        {
            Name = name;
            Path = path;
            Time = time;
            Hash = hash;
        }

        public Snapshot(string name, string path, string time, string hash, Color color) : this(name, path, time, hash)
        {
            Color = color;
        }

        public Snapshot(string name, string path, string time, string hash, Bitmap shot) : this(name, path, time, hash)
        {
            Shot = shot;
        }

        #endregion
    }
}

Generated by GNU Enscript 1.6.5.90.