Ejemplo n.º 1
0
        /// <summary>Clones and merge the settings with the settings in this instance.</summary>
        /// <param name="settings">The settings to clone and merge with the instance.</param>
        /// <returns>Feed.</returns>
        public Feed CloneAndMergeSettings(SettingsCollection settings)
        {
            var newFeed = this.Clone();

            newFeed.Settings.Combine(settings);
            return(newFeed);
        }
Ejemplo n.º 2
0
        /// <summary>Clones the and merge settings.</summary>
        /// <param name="settings">The collection of settungs to clone and merge.</param>
        /// <returns>Action.</returns>
        public Action CloneAndMergeSettings(SettingsCollection settings)
        {
            var newAction = this.Clone();

            newAction.Settings.Combine(settings);
            return(newAction);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Clones this instance of the Command and merges the settings parameter
        /// with the instances settings.
        /// </summary>
        /// <param name="settings">The settings to merge with the instance settings.</param>
        /// <returns>Returns a new instance of the Command with the settings merged.</returns>
        public Command CloneAndMergeSettings(SettingsCollection settings)
        {
            var newCommand = this.Clone();

            newCommand.Settings.Combine(settings);
            return(newCommand);
        }
 /// <summary>
 /// Combines the unique values from the settings parameter to this collection.
 /// </summary>
 /// <param name="settings">The settings to combine with this instance.</param>
 /// <remarks>
 /// Only items with a unique key in the settings parameter are combined with the base settings.
 /// </remarks>
 public void Combine(SettingsCollection settings)
 {
     foreach (var kvp in settings.Where(kvp => !this.ContainsKey(kvp.Key)))
     {
         this.Add(kvp.Key, kvp.Value);
     }
 }
Ejemplo n.º 5
0
        /// <summary>Clones and merge the settings.</summary>
        /// <param name="settings">The settings to clone and merge with the instance settings.</param>
        /// <returns>Observer.</returns>
        public Observer CloneAndMergeSettings(SettingsCollection settings)
        {
            var newObserver = this.Clone();

            newObserver.Settings.Combine(settings);
            return(newObserver);
        }
Ejemplo n.º 6
0
 public static bool DeleteFromTarget(this Settings.SettingsCollection settings)
 {
     return(settings.GetCustomSetting <bool>("DeleteFromTarget"));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SettingsCollection"/> class.
 /// </summary>
 /// <param name="settings">The settings.</param>
 public SettingsCollection(SettingsCollection settings)
     : base(settings, StringComparer.CurrentCultureIgnoreCase)
 {
 }
Ejemplo n.º 8
0
 /// <summary>
 /// An extension method that gets the MessageTemplate setting for the specified event type from the settings collection.
 /// </summary>
 /// <param name="settings">The settings collection.</param>
 /// <param name="eventType">Type of the event.</param>
 /// <returns>Returns a System.String representing the template or null if the template doesn't exist.</returns>
 public static string MessageTemplate(this Settings.SettingsCollection settings, ActionEventType eventType)
 {
     return(settings.GetCustomSetting <string>($"MessageTemplate-{eventType.EventType}"));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// An extension method that gets the ContentType setting from the settings collection.
 /// </summary>
 /// <param name="settings">The settings collection.</param>
 /// <returns>System.String.</returns>
 public static string ContentType(this Settings.SettingsCollection settings)
 {
     return(settings.GetCustomSetting("ContentType", "application/json"));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// An extension method that gets the URL setting from the settings collection.
 /// </summary>
 /// <param name="settings">The settings collection.</param>
 /// <returns>System.String.</returns>
 public static string Url(this Settings.SettingsCollection settings)
 {
     return(settings.GetCustomSetting <string>("Url"));
 }