Example #1
0
        void ReadOptions(XmlNode options)
        {
            if (options == null)
            {
                return;
            }

            XmlNode node = options.SelectSingleNode("//debug");

            if (node != null)
            {
                Debug = true;
            }

            node = options.SelectSingleNode("//baseTemplatePath");
            if (node != null)
            {
                BaseTemplatePath = node.Attributes.GetRequired <string> ("value");
            }

            node = options.SelectSingleNode("//smtpServer");
            var smtpCfg = new SmtpServerConfig();

            if (node != null)
            {
                try {
                    smtpCfg.Read(node);
                } catch (Exception ex) {
                    Log(ex, "Failure to read SMTP server configuration from the config file. Falling back to default settings.");
                    smtpCfg = new SmtpServerConfig();
                }
            }
            SmtpServer = smtpCfg;

            node = options.SelectSingleNode("//periodicSender");
            if (node != null)
            {
                PeriodicSenderInterval = node.Attributes.GetRequired <uint> ("interval");
            }

            ReadGitHubApiSettings(node.SelectSingleNode("//gitHubApiCredentials"));
        }
Example #2
0
        void ReadOptions(XmlNode options)
        {
            if (options == null)
                return;

            XmlNode node = options.SelectSingleNode ("//debug");
            if (node != null)
                Debug = true;

            node = options.SelectSingleNode ("//baseTemplatePath");
            if (node != null)
                BaseTemplatePath = node.Attributes.GetRequired<string> ("value");

            node = options.SelectSingleNode ("//smtpServer");
            var smtpCfg = new SmtpServerConfig ();
            if (node != null) {
                try {
                    smtpCfg.Read (node);
                } catch (Exception ex) {
                    Log (ex, "Failure to read SMTP server configuration from the config file. Falling back to default settings.");
                    smtpCfg = new SmtpServerConfig ();
                }
            }
            SmtpServer = smtpCfg;
        }