CultureAndRegionInfoBuilder builder = new CultureAndRegionInfoBuilder(culrureName, CultureAndRegionModifiers.Replacement);
CultureInfo c = new CultureInfo(culrureName);
List
PersianCalendar persianCalendar = new PersianCalendar();
list.Add(persianCalendar);
list.AddRange(c.OptionalCalendars);
builder.AvailableCalendars = list.ToArray();
DateTimeFormatInfo info = builder.GregorianDateTimeFormat;
//itPersianDateTimeFormat(info);
builder.GetType().GetField("m_defaultCalendar", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(builder, persianCalendar);
builder.Register();
the exception is:
NotSupportedException:Custom calendars are not currently supported.
i search all the internet and i can find one article that say it is because of domain safety check . anyone can help me to solve it?
Amrollah NeamatiPosted Feb 22, 2010, 3:19 AM
my calendar have different calculation rules.it is not JulianCalendar ,ChineseLunisolarCalendar , GregorianCalendar....
these calendars is on CultureAndRegionInfoBuilder.AvailableCalendars array.i want to define new calendar type with different calculation rules/methods and add it to CultureAndRegionInfoBuilder.AvailableCalendars and register it on .net , then other .net applications in windows can use it.
Sam HobbsPosted Feb 22, 2010, 3:03 AM