Ejemplo n.º 1
0
        public static WebhookConnecSubscriptions LoadFromJson(JObject obj)
        {
            var config = new WebhookConnecSubscriptions();

            foreach (var x in obj)
            {
                config[StringExtensions.ToCamelCase(x.Key)] = x.Value.Value <Boolean>();
            }
            return(config);
        }
        /// <summary>
        /// Load WebhookConnec configuration into a WebhookConnec configuration object
        /// </summary>
        /// <returns>A WebhooAccount configuration object</returns>
        public static WebhookConnecSubscriptions Load(string preset = "maestrano")
        {
            var config = ConfigurationManager.GetSection(preset + "/webhook/connecSubscriptions") as WebhookConnecSubscriptions;

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

            return(config);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Load WebhookConnec configuration into a WebhookConnec configuration object
        /// </summary>
        /// <returns>A WebhooAccount configuration object</returns>
        public static WebhookConnec Load()
        {
            var config = ConfigurationManager.GetSection("maestrano/webhook/connec") as WebhookConnec;

            if (config == null)
            {
                config = new WebhookConnec();
            }
            config.Subscriptions = WebhookConnecSubscriptions.Load();

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

            if (config == null)
            {
                config = new WebhookConnec();
            }
            config.Subscriptions = WebhookConnecSubscriptions.Load();

            return(config);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Load Webhook into a WebhookAccount configuration object from a JObject
        /// </summary>
        /// <returns>A WebhookAccount configuration object</returns>
        public static WebhookConnec LoadFromJson(String preset, JObject obj)
        {
            var config = new WebhookConnec();

            config.NotificationsPath = obj["notification_path"].Value <string>();
            if (obj["connec_subscriptions"] == null)
            {
                config.Subscriptions = WebhookConnecSubscriptions.Load();
            }
            else
            {
                config.Subscriptions = WebhookConnecSubscriptions.LoadFromJson(preset, obj["connec_subscriptions"].Value <JObject>());
            }

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

            return config;
        }