~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/Twitterizer/Twitterizer2/Core/OptionalProperties.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            // Set the default values for the properties
53
53
            this.UseSSL = false;
54
54
            this.APIBaseAddress = "http://api.twitter.com/1/";
55
 
 
56
 
#if !LITE && !SILVERLIGHT
57
 
            this.CacheOutput = false;
58
 
            this.CacheTimespan = new TimeSpan(0, 5, 0);
59
 
            this.ReadConfigurationSettings();
60
 
#endif
61
55
        }
62
56
 
63
57
        /// <include file='OptionalProperties.xml' path='OptionalProperties/Property[@name="UseSSL"]/*'/>
73
67
        /// <include file='OptionalProperties.xml' path='OptionalProperties/Property[@name="Proxy"]/*'/>
74
68
        public WebProxy Proxy { get; set; }
75
69
#endif
76
 
 
77
 
#if !LITE && !SILVERLIGHT
78
 
        /// <include file='OptionalProperties.xml' path='OptionalProperties/Property[@name="CacheOutput"]/*'/>
79
 
        public bool CacheOutput { get; set; }
80
 
 
81
 
        /// <include file='OptionalProperties.xml' path='OptionalProperties/Property[@name="CacheTimespan"]/*'/>
82
 
                public TimeSpan CacheTimespan { get; set; }
83
 
 
84
 
                /// <summary>
85
 
        /// Reads the configuration settings.
86
 
        /// </summary>
87
 
        private void ReadConfigurationSettings()
88
 
        {
89
 
 
90
 
            System.Collections.Specialized.NameValueCollection appSettings = ConfigurationManager.AppSettings;
91
 
 
92
 
            // Get the enable caching configuration setting
93
 
            if (!string.IsNullOrEmpty(appSettings["Twitterizer2.EnableCaching"]) &&
94
 
                appSettings["Twitterizer2.EnableCaching"].ToLower().Trim() == "true")
95
 
            {
96
 
                this.CacheOutput = true;
97
 
            }
98
 
 
99
 
            // Get the cache timeout setting
100
 
            string cacheTimeoutSetting = appSettings["Twitterizer2.CacheTimeout"];
101
 
            long cacheTimeoutSeconds;
102
 
            if (!string.IsNullOrEmpty(appSettings["Twitterizer2.CacheTimeout"]) &&
103
 
                long.TryParse(cacheTimeoutSetting, out cacheTimeoutSeconds))
104
 
            {
105
 
                // Convert the seconds value to ticks and instantiate a new timespan
106
 
                this.CacheTimespan = new TimeSpan(cacheTimeoutSeconds * 10000000);
107
 
            }
108
 
 
109
 
            // Get the SSL setting
110
 
            if (!string.IsNullOrEmpty(appSettings["Twitterizer2.EnableSSL"]) &&
111
 
                appSettings["Twitterizer2.EnableSSL"].ToLower().Trim() == "true")
112
 
            {
113
 
                this.UseSSL = true;
114
 
            }
115
 
        }
116
 
#endif
117
 
        }
 
70
    }
118
71
}