I've not made the kind of progress I had hoped for this weekend, even with the help of an extra hour with the clocks going back. The upshot is I've re-scheduled for a week later than anticipated, on 7th Nov.
I could point to domestic responsibilities: 4 year olds who refuse to go to bed, the need to mow the gardens before the weather takes a more autumnal turn. Let's be honest here though - there's also the learning of some quite unfamiliar material found in the objectives of 70-536 which has taken more time than I'd expected. For instance, I've sought some additional resources on Code Access Security
here and
here. It's not something you can just read and absorb first time around. I found some consensus within the comments of the latter CodeProject article.
Also, I've made some efforts to continue with working examples where applicable which can consume time. It's one thing I've done more of compared to preparing for 70-315 which was more taking notes like for a University exam. Below is a code snippet from my tour of 'globalization'. Some things do get overwritten but I've tried to preserve the extent of the exploration. Also, I've never used the code coloriser within DasBlog's admin pages. I've had to do some manual indentation to get things looking more readable.
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using System.Threading;
namespace GlobalizeThis
{
class Program
{
static void Main(string[] args)
{
Console.ReadKey(true);
}
static void AlreadyTested()
{
//CultureInfoExample1();
//Thread.CurrentThread.CurrentCulture = new CultureInfo("es-VE");CultureInfoExample1();
//FormattingExample1(); CultureInfoExample2(); CultureInfoExample3();
//RegionInfoExample();
//Thread.CurrentThread.CurrentCulture = new CultureInfo("es-VE"); RegionInfoExample();
//Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); RegionInfoExample();
//DateTimeExample1();DateTimeExample2();
//NumberFormat();
//CompareInfoExample1();
//CompareInfoExample2();CompareInfoExample3();
}
static void CompareInfoExample3()
{
string s1 = "Coté";
string s2 = "coté";
CompareInfo demoInfo = new CultureInfo("fr-FR").CompareInfo;
w("if zero then equal. non-zero values indicate differences", demoInfo.Compare(s1, s2, CompareOptions.IgnoreCase).ToString());
}
static void CompareInfoExample2()
{
string s1 = "Coté";
string s2 = "coté";
CompareInfo demoInfo = new CultureInfo("fr-FR").CompareInfo;
w("if zero then equal. non-zero values indicate differences", demoInfo.Compare(s1, s2).ToString());
}
static void CompareInfoExample1()
{
CompareInfo demoInfo1 = Thread.CurrentThread.CurrentCulture.CompareInfo;
w("name of compareinfo", demoInfo1.Name);
w("LCID of compareinfo", demoInfo1.LCID.ToString());
CompareInfo demoInfo2 = new CultureInfo("en-US").CompareInfo;
w("name of compareinfo", demoInfo2.Name);
w("LCID of compareinfo", demoInfo2.LCID.ToString());
}
static void NumberFormat()
{
CultureInfo usersCulture = new CultureInfo("es-VE");
w("Venez Currency", usersCulture.NumberFormat.CurrencySymbol);
w("Number decimal separator", usersCulture.NumberFormat.NumberDecimalSeparator);
}
static void DateTimeExample2()
{
CultureInfo myCulture = Thread.CurrentThread.CurrentCulture;
CultureInfo usersCulture = new CultureInfo("es-VE");
int i = 0;
//string[] months = usersCulture.DateTimeFormat.MonthNames;
string[] months = usersCulture.DateTimeFormat.AbbreviatedMonthNames;
foreach (string venezMonth in months)
{
w(myCulture.DateTimeFormat.MonthNames[i++], venezMonth);
}
w("no of months", months.Length.ToString());
}
static void DateTimeExample1()
{
CultureInfo myCulture = Thread.CurrentThread.CurrentCulture;
CultureInfo usersCulture = new CultureInfo("es-VE");
int i = 0;
string[] days = usersCulture.DateTimeFormat.DayNames;
foreach (string venezDay in days)
{
w(myCulture.DateTimeFormat.DayNames[i++], venezDay);
}
}
static void RegionInfoExample()
{
CultureInfo usersCulture = Thread.CurrentThread.CurrentCulture;
RegionInfo demoRegion = new RegionInfo(usersCulture.LCID);
w("English Name", demoRegion.EnglishName);
w("Display Name", demoRegion.DisplayName);
w("Currency Symbol", demoRegion.CurrencySymbol);
w("Is Metric", demoRegion.IsMetric.ToString());
}
static void CultureInfoExample3()
{
foreach (CultureInfo userCulture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
w("Culture", userCulture.Name);
}
}
static void CultureInfoExample2()
{
CultureInfo usersCulture = Thread.CurrentThread.CurrentUICulture;
w("The current culture of this application is", usersCulture.Name);
}
static void FormattingExample1()
{
w("Salary is", (100000).ToString("C"));
}
static void CultureInfoExample1()
{
CultureInfo usersCulture = Thread.CurrentThread.CurrentCulture;
w("The current culture of this application is", usersCulture.Name);
w("The display name of this application is", usersCulture.DisplayName);
w("The native name of this application is", usersCulture.NativeName);
w("The ISO Abbreviation of this application is", usersCulture.TwoLetterISOLanguageName);
}
static void w(string p, string s)
{
Console.WriteLine("{0} : {1}", p, s);
}
}
}