This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dictionary<string, string> cultureDetails = new Dictionary<string, string>(); | |
foreach (CultureInfo cultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) | |
{ | |
RegionInfo regionInfo = new RegionInfo(cultureInfo.Name); | |
if (!cultureDetails.ContainsKey(regionInfo.EnglishName)) | |
{ | |
cultureDetails.Add(regionInfo.EnglishName, regionInfo.Name); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RegionInfo regionInfo = new RegionInfo(cultureInfo.Name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Month Names | |
var monthNames = CultureInfo.CurrentCulture.DateTimeFormat.MonthNames; | |
// Day Names | |
var dayNames = CultureInfo.CurrentCulture.DateTimeFormat.DayNames; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CultureInfo cultureInfo = new CultureInfo("fr-FR"); | |
Thread.CurrentThread.CurrentCulture = cultureInfo; | |
Thread.CurrentThread.CurrentUICulture = cultureInfo; | |
var dayNames = CultureInfo.CurrentCulture.DateTimeFormat.DayNames; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Time zones | |
ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task GetTwitterResults() | |
{ | |
WebClient wc = new WebClient(); | |
var result; | |
using (WebClient client = new WebClient()) | |
{ | |
result = await client.DownloadStringTaskAsync("http://search.twitter.com/search.json?q=bookatable%20:)&show-user=true"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<httpRuntime ... encoderType="System.Web.Security.AntiXss.AntiXssEncoder,System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ObjectCache _cache = MemoryCache.Default; | |
private CacheItemPolicy _policy = new CacheItemPolicy(); | |
public string RetrieveFileContents() | |
{ | |
// Build a key that we can use to cache the contents in memory against | |
const string cacheKey = "fileContents"; | |
// Check if the data exists in cache | |
string fileContents = _cache.Get(cacheKey) as string; |