Beispiel #1
0
 public void RemoveSettings(ToasterSettings toasterSettings)
 {
     if (_toasterSettingsCollection.Remove(toasterSettings) && AutoSaveOnAddOrRemove)
     {
         Save();
     }
 }
Beispiel #2
0
        public void AddSettings(ToasterSettings toasterSettings)
        {
            if (string.IsNullOrWhiteSpace(toasterSettings.Name))
            {
                throw new ArgumentException("The settings name cannot be empty or null.");
            }

            if (ToastSettings.Any(p => p.Name == toasterSettings.Name))
            {
                throw new ArgumentException("A toast settings object already exists with that name.");
            }

            _toasterSettingsCollection.Add(toasterSettings);

            if (AutoSaveOnAddOrRemove)
            {
                Save();
            }
        }
Beispiel #3
0
        public ToasterSettings Clone(string newName)
        {
            var settings = new ToasterSettings(newName);

            settings.QueueToasts          = QueueToasts;
            settings.EnterFromDirection   = EnterFromDirection;
            settings.LeaveDirection       = LeaveDirection;
            settings.MoveDirection        = MoveDirection;
            settings.HorizontalAdjustment = HorizontalAdjustment;
            settings.HorizontalPadding    = HorizontalPadding;
            settings.VerticalAdjustment   = VerticalAdjustment;
            settings.VerticalPadding      = VerticalPadding;
            settings.EnterStyle           = EnterStyle;
            settings.MoveDuration         = MoveDuration;
            settings.LeaveStyle           = LeaveStyle;
            settings.EnterLocation        = EnterLocation;
            settings.MoveStyle            = MoveStyle;

            return(settings);
        }