Exemplo n.º 1
0
        static ConfigService()
        {
            areas = new string[0];
            releases = new string[0];
            breadcrumbs = new Breadcrumb[0];
            types = new[] { IssueType.Bug, IssueType.Feature };

            Mail = new MailConfig()
            {
                From = WebConfigurationManager.AppSettings["mail.from"],
                Server = WebConfigurationManager.AppSettings["mail.server"],
                Port = WebConfigurationManager.AppSettings["mail.port"] != null ? Int32.Parse(WebConfigurationManager.AppSettings["mail.port"]) : 0,
                Username = WebConfigurationManager.AppSettings["mail.username"],
                Password = WebConfigurationManager.AppSettings["mail.password"],
                RequireSsl = WebConfigurationManager.AppSettings["mail.ssl"] != null ? Boolean.Parse(WebConfigurationManager.AppSettings["mail.ssl"]) : false,
            };
        }
Exemplo n.º 2
0
        public static void InitializeWithConfig(Config config)
        {
            if (config == null)
            {
                NoConfig = true;
            }
            else
            {
                AppName = config.ApplicationName;
                AppSubName = config.ApplicationSubName;
                areas = config.Areas;
                releases = config.Releases;
                breadcrumbs = config.ExternalBreadcrumbs;
                Mail = new MailConfig()
                {
                    From = config.MailFrom ?? config.MailUsername,
                    Server = config.MailServer,
                    Port = config.MailPort,
                    RequireSsl = config.MailSsl,
                    Username = config.MailUsername,
                    Password = config.MailPassword,
                };
            }

            if (String.IsNullOrEmpty(AppName))
            {
                AppName = WebConfigurationManager.AppSettings["app.name"] ?? "tinyBugs";
                AppSubName = WebConfigurationManager.AppSettings["app.subname"] ?? "no issue is too small";
            }
        }
Exemplo n.º 3
0
        public static void InitializeWithConfig(Config config)
        {
            if (config == null)
            {
                NoConfig = true;
            }
            else
            {
                AppName = config.ApplicationName;
                AppSubName = config.ApplicationSubName;
                areas = config.Areas;
                releases = config.Releases;
                breadcrumbs = config.ExternalBreadcrumbs;

                // If the mail server was not configured by the web.config, populate the mail
                // configuration from the provided config information.
                if (String.IsNullOrEmpty(Mail.Server))
                {
                    Mail = new MailConfig()
                    {
                        From = config.MailFrom ?? config.MailUsername,
                        Server = config.MailServer,
                        Port = config.MailPort,
                        RequireSsl = config.MailSsl,
                        Username = config.MailUsername,
                        Password = config.MailPassword,
                    };
                }
            }

            if (String.IsNullOrEmpty(AppName))
            {
                AppName = WebConfigurationManager.AppSettings["app.name"] ?? "tinyBugs";
                AppSubName = WebConfigurationManager.AppSettings["app.subname"] ?? "no issue is too small";
            }
        }