TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amrollah Neamati
NA
6
0
NotSupportedException:Custom calendars are not currently supported.
Feb 21 2010 5:43 PM
It is possible to create my own Calendar classes by inheriting from the Calendar class and then implementing all of the Calendar classes' abstract members. The problem is that when you attempt to assign this new Calendar to the an Exception is thrown:
CultureAndRegionInfoBuilder builder = new CultureAndRegionInfoBuilder(culrureName, CultureAndRegionModifiers.Replacement);
CultureInfo c = new CultureInfo(culrureName);
List<Calendar> list = new List<Calendar>();
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?
Reply
Answers (
2
)
redirect with hiding page detail
How do I change the color of a cell in Excel based on a Condition?