本文整理匯總了C#中System.Globalization.Calendar.AddLocale方法的典型用法代碼示例。如果您正苦於以下問題:C# Calendar.AddLocale方法的具體用法?C# Calendar.AddLocale怎麽用?C# Calendar.AddLocale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Globalization.Calendar
的用法示例。
在下文中一共展示了Calendar.AddLocale方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateSampleModels
public new void CreateSampleModels()
{
var calendar = new Calendar("CAL_0000");
calendar.AddMetadata("a", new MetadataValue("A"));
calendar.AddMetadata("b", new MetadataValue("B"));
calendar.AddLocale(new CultureInfo("en"), new CalendarLocale {Name = "Calendar"});
calendar.AddLocale(new CultureInfo("ko"), new CalendarLocale {Name = "달력"});
Repository<Calendar>.SaveOrUpdate(calendar);
var calendarRule = new CalendarRule(calendar, "테스트규칙");
Repository<CalendarRule>.SaveOrUpdate(calendarRule);
}
示例2: CalendarTestByUnitOfWork
public void CalendarTestByUnitOfWork()
{
var calendar = new Calendar("CAL_0001");
calendar.AddMetadata("a", new MetadataValue("A"));
calendar.AddMetadata("b", new MetadataValue("B"));
calendar.AddLocale(new CultureInfo("en"), new CalendarLocale {Name = "System Calendar"});
calendar.AddLocale(new CultureInfo("ko"), new CalendarLocale {Name = "시스템달력"});
Repository<Calendar>.SaveOrUpdate(calendar);
UnitOfWork.Current.TransactionalFlush();
UnitOfWork.Current.Clear();
var loaded = Repository<Calendar>.Get(calendar.Id);
Assert.AreEqual(calendar, loaded);
loaded.LocaleMap.Count.Should().Be(2);
}