Beispiel #1
0
        public static Metadata Load(string configurationFileLocation)
        {
            var configuration = XDocument.Load(configurationFileLocation);

            var metaData = new Metadata
                {
                    Title = GetField(configuration, "Title", String.Empty),
                    WebsiteUrl = GetField(configuration, "WebsiteUrl", String.Empty),
                    DefaultDescription = GetField(configuration, "DefaultDescription", String.Empty),
                    DefaultKeywords = GetField(configuration, "DefaultKeywords", String.Empty),
                    FileStorageConnectionString = GetField(configuration, "FileStorageConnectionString", String.Empty),
                    FileStorageUrl = GetField(configuration, "FileStorageUrl", String.Empty),
                    FacebookLogo = GetField(configuration, "FacebookLogo", String.Empty),
                    FacebookApplicationId = GetField(configuration, "FacebookApplicationId", String.Empty),
                    FacebookApplicationSecret = GetField(configuration, "FacebookApplicationSecret", String.Empty),
                    SmtpHost = GetField(configuration, "SmtpHost", String.Empty),
                    MailFrom = GetField(configuration, "MailFrom", String.Empty),
                    SmtpUserName = GetField(configuration, "SmtpUserName", String.Empty),
                    SmtpPassword = GetField(configuration, "SmtpPassword", String.Empty),
                    SmtpPort = GetField(configuration, "SmtpPort", 25)
                };


            return metaData;
        }
Beispiel #2
0
        public static Metadata Load(string configurationFileLocation)
        {
            try
            {
                var configuration = XDocument.Load(configurationFileLocation);

                var instance = new Metadata
                {
                    Title = GetField(configuration, "Title", String.Empty),
                    WebsiteUrl = GetField(configuration, "WebsiteUrl", String.Empty),
                    DefaultDescription = GetField(configuration, "DefaultDescription", String.Empty),
                    DefaultKeywords = GetField(configuration, "DefaultKeywords", String.Empty),
                    FileStorageConnectionString = GetField(configuration, "FileStorageConnectionString", String.Empty),
                    FileStorageUrl = GetField(configuration, "FileStorageUrl", String.Empty),
                    BlobContainerName = GetField(configuration, "BlobContainerName", String.Empty),
                    FacebookLogo = GetField(configuration, "FacebookLogo", String.Empty),
                    FacebookApplicationId = GetField(configuration, "FacebookApplicationId", String.Empty),
                    FacebookApplicationSecret = GetField(configuration, "FacebookApplicationSecret", String.Empty),
                    SmtpHost = GetField(configuration, "SmtpHost", String.Empty),
                    MailFrom = GetField(configuration, "MailFrom", String.Empty),
                    SmtpUserName = GetField(configuration, "SmtpUserName", String.Empty),
                    SmtpPassword = GetField(configuration, "SmtpPassword", String.Empty),
                    SupportEmail = GetField(configuration, "SupportEmail", String.Empty),
                    SmtpPort = GetField(configuration, "SmtpPort", 25),
                    PageSize = GetField(configuration, "PageSize", 15)
                };


                return instance;
            }
            catch
            {
                return null;
            }
        }
Beispiel #3
0
 public static void Initialize(Metadata metadata)
 {
     _current = metadata;
 }