本文整理汇总了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);
}