Ejemplo n.º 1
0
        /// <summary>
        /// Saves the specified settings.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public static void Save(ClientSettings settings)
        {
            if (settings == null) throw new ArgumentNullException(nameof(settings));

            try
            {
                var serializer = new XmlSerializer(typeof (ClientSettings));
                using (var writer = new StreamWriter(GetFilePath()))
                    serializer.Serialize(writer, settings);
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        public object Clone()
        {
            var settings = new ClientSettings
            {
                ApiKey = this.ApiKey,
                EQFolder = this.EQFolder,
                IgnoreList = this.IgnoreList,
                MinimizeToTray = this.MinimizeToTray,
                EnableToasts = this.EnableToasts,
                ToastDisplayForSeconds = this.ToastDisplayForSeconds,
                StartWithWindows = this.StartWithWindows,
                TodayAuctionCount = this.TodayAuctionCount,
                LifetimeAuctionCount = this.LifetimeAuctionCount,
                LastDateCounted = this.LastDateCounted,
                TrackStateInSystemTray = this.TrackStateInSystemTray
            };

            return settings;
        }