コード例 #1
0
ファイル: Webhook.cs プロジェクト: paulduran/maestrano-dotnet
        /// <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);
        }
コード例 #2
0
        /// <summary>
        /// Load WebhookConnec configuration into a WebhookConnec configuration object
        /// </summary>
        /// <returns>A WebhooAccount configuration object</returns>
        public static WebhookConnec Load(string preset = "maestrano")
        {
            var config =  ConfigurationManager.GetSection(preset + "/webhook/connec") as WebhookConnec;
            if (config == null) config = new WebhookConnec();
            config.Subscriptions = WebhookConnecSubscriptions.Load();

            return config;
        }
コード例 #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);
        }
コード例 #4
0
        /// <summary>
        /// Load Webhook into a WebhookAccount configuration object from a JObject
        /// </summary>
        /// <returns>A WebhookAccount configuration object</returns>
        public static WebhookConnec LoadFromJson(JObject obj)
        {
            var config = new WebhookConnec();

            config.NotificationPath   = obj["notification_path"].Value <string>();
            config.InitializationPath = obj["initialization_path"].Value <string>();
            config.ExternalIds        = obj["external_ids"].Value <bool>();
            config.Subscriptions      = new WebhookConnecSubscriptions();
            return(config);
        }
コード例 #5
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);
        }
コード例 #6
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);
        }
コード例 #7
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);
        }
コード例 #8
0
 public Webhook(string preset = "maestrano")
 {
     Account = WebhookAccount.Load(preset);
     Connec  = WebhookConnec.Load(preset);
 }
コード例 #9
0
ファイル: Webhook.cs プロジェクト: prosser/maestrano-dotnet
 public Webhook()
 {
     Account = WebhookAccount.Load();
     Connec  = WebhookConnec.Load();
 }