namespace Wayne.Lib.IO
{
    /// <summary>
    /// Event argument that is used to notify and ask what action to take if a partially written file is found.
    /// </summary>
    public class SafeFileWritingCleanupEventArgs : UserTokenEventArgs
    {
        #region Fields

        private SafeFileWritingCleanupAction action = SafeFileWritingCleanupAction.Delete;
        private string fileName;

        #endregion

        /// <summary>
        /// Creates a new instance of the SafeFileWritingCleanupEventArgs class.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="userToken"></param>
        internal SafeFileWritingCleanupEventArgs(string fileName, object userToken)
            : base(userToken)
        {
            this.fileName = fileName;
        }

        #region Properties

        /// <summary>
        /// Sets or gets the action to take for the found temporary file.
        /// </summary>
        public SafeFileWritingCleanupAction Action
        {
            get { return action; }
            set { action = value; }
        }

        /// <summary>
        /// Name of the found temporary file.
        /// </summary>
        public string FileName
        {
            get { return fileName; }
        }
        #endregion

    }
}