/// <summary>
        /// Load WebhooAccount configuration into a WebhooAccount configuration object
        /// </summary>
        /// <returns>A WebhooAccount configuration object</returns>
        public static WebhookAccount Load(string preset = "maestrano")
        {
            var config = ConfigurationManager.GetSection(preset + "/webhook/account") as WebhookAccount;
            if (config == null) config = new WebhookAccount();

            return config;
        }
Esempio n. 2
0
        /// <summary>
        /// Load Webhook into a WebhookAccount configuration object from a JObject
        /// </summary>
        /// <returns>A WebhookAccount configuration object</returns>
        public static WebhookAccount LoadFromJson(JObject obj)
        {
            var config = new WebhookAccount();

            config.GroupPath     = obj["group_path"].Value <string>();
            config.GroupUserPath = obj["group_user_path"].Value <string>();
            return(config);
        }
Esempio n. 3
0
        /// <summary>
        /// Load Webhook into a Connec configuration object from a JObject
        /// </summary>
        /// <returns>A Webhook configuration object</returns>
        public static Webhook LoadFromJson(JObject obj)
        {
            var config = new Webhook();

            config.Account = WebhookAccount.LoadFromJson(obj["account"].Value <JObject>());
            config.Connec  = WebhookConnec.LoadFromJson(obj["connec"].Value <JObject>());
            return(config);
        }
Esempio n. 4
0
        /// <summary>
        /// Load Webhook configuration into a Webhook configuration object
        /// </summary>
        /// <returns>A Webhook configuration object</returns>
        public static Webhook Load(string preset = "maestrano")
        {
            var config = new Webhook();

            config.Account = WebhookAccount.Load(preset);
            config.Connec  = WebhookConnec.Load(preset);
            return(config);
        }
Esempio n. 5
0
        /// <summary>
        /// Load WebhooAccount configuration into a WebhooAccount configuration object
        /// </summary>
        /// <returns>A WebhooAccount configuration object</returns>
        public static WebhookAccount Load()
        {
            var config = ConfigurationManager.GetSection("maestrano/webhook/account") as WebhookAccount;

            if (config == null)
            {
                config = new WebhookAccount();
            }

            return(config);
        }
Esempio n. 6
0
        /// <summary>
        /// Load WebhooAccount configuration into a WebhooAccount configuration object
        /// </summary>
        /// <returns>A WebhooAccount configuration object</returns>
        public static WebhookAccount Load(string preset = "maestrano")
        {
            ConfigurationManager.RefreshSection(preset + "/webhook/account");
            var config = ConfigurationManager.GetSection(preset + "/webhook/account") as WebhookAccount;

            if (config == null)
            {
                config = new WebhookAccount();
            }

            return(config);
        }
Esempio n. 7
0
 public Webhook(string preset = "maestrano")
 {
     Account = WebhookAccount.Load(preset);
     Connec  = WebhookConnec.Load(preset);
 }
Esempio n. 8
0
 public Webhook()
 {
     Account = WebhookAccount.Load();
     Connec  = WebhookConnec.Load();
 }