Beispiel #1
0
 static MnoHelper()
 {
     App     = Configuration.App.Load();
     Api     = Configuration.Api.Load();
     Connec  = Configuration.Connec.Load();
     Webhook = Configuration.Webhook.Load();
     Sso     = Configuration.Sso.Load();
 }
        static MnoHelper()
        {
            // Initialize preset list
            presetDict = new Dictionary <string, Preset>();

            // Load "maestrano" preset by default
            defaultPreset = new Preset("maestrano");

            // Emulate old configuration behaviour for backward
            // compatibility
            App     = defaultPreset.App;
            Api     = defaultPreset.Api;
            Connec  = defaultPreset.Connec;
            Webhook = defaultPreset.Webhook;
            Sso     = defaultPreset.Sso;
        }
Beispiel #3
0
        /// <summary>
        /// Clear a preset configuration
        /// </summary>
        /// <param name="presetName">name of preset to clear</param>
        public static void ClearPreset(string presetName)
        {
            if (presetDict.ContainsKey(presetName))
            {
                presetDict.Remove(presetName);
            }

            if (presetName.Equals("maestrano"))
            {
                defaultPreset = new Preset("maestrano");
                presetDict.Add("maestrano", defaultPreset);

                // Emulate old configuration behaviour for backward
                // compatibility
                App = defaultPreset.App;
                Api = defaultPreset.Api;
                Connec = defaultPreset.Connec;
                Webhook = defaultPreset.Webhook;
                Sso = defaultPreset.Sso;
            }
        }