예제 #1
0
        /// <summary>
        /// Adds existingPreset
        /// </summary>
        /// <param name="preset"></param>
        public bool AddPreset(Preset preset)
        {
            if (preset != null && !PresetCollection.Contains(preset))
            {
                PresetCollection.Add(preset);
                return(true);
            }

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Creates and adds a new existingPreset when equaled a new existingPreset doesn't
        /// exist in <see cref="Repository.PresetCollection"/> presetCollection.
        /// </summary>
        /// <returns><see cref="Boolean"/> if existingPreset added</returns>
        public bool CreateNewPreset()
        {
            bool res;
            var  firstDefaultNamedPreset = FindFirstDefaultNamedPreset();

            // if new Preset does not exist
            if (firstDefaultNamedPreset == null)
            {
                PresetCollection.Add(Preset.GetDefaultPreset());
                res = true;
            }
            else
            {
                RiseCantCreateNewPreset(firstDefaultNamedPreset);
                res = false;
            }

            return(res);
        }