Exemple #1
0
        /// <summary>
        /// Creates SyncToFile object
        /// </summary>
        /// <param name="itemToWatch">Object with Changed event</param>
        /// <param name="filename">Path of file to write to</param>
        /// <param name="minDay">Minimum number of days to wait between writing to disk after Changed event</param>
        /// <param name="minHour">Minimum number of hours to wait between writing to disk after Changed event</param>
        /// <param name="minMinute">Minimum number of minutes to wait between writing to disk after Changed event</param>
        /// <param name="minSeconds">Minimum number of seconds to wait between writing to disk after Changed event</param>
        /// <param name="minMs">Minimum number of milliseconds to wait between writing to disk after Changed event</param>
        public SyncToFile(ISerializeWatchable itemToWatch, string filename,
                int minDay = _minDayDefault, int minHour = _minHourDefault, int minMinute = _minMinDefault, int minSeconds = _minSecDefault, int minMs = _minMsDefault)
        {
            _itemToWatch = itemToWatch;
            Filename = filename;
            ConstructorHelper();

            _minTimeToSave = new TimeSpan(minDay, minHour, minMinute, minSeconds, minMs);
        }
Exemple #2
0
        /// <summary>
        /// Creates SyncToFile object
        /// </summary>
        /// <param name="itemToWatch">Object with Changed event</param>
        /// <param name="filename">Path of file to write to</param>
        /// <param name="minTimeToSave">Minimum amount of time to wait between writing to disk after Changed event</param>
        public SyncToFile(ISerializeWatchable itemToWatch, string filename, TimeSpan minTimeToSave)
        {
            _itemToWatch = itemToWatch;
            Filename = filename;
            ConstructorHelper();

            _minTimeToSave = minTimeToSave;
        }