本文整理汇总了C#中Thing.Serviced方法的典型用法代码示例。如果您正苦于以下问题:C# Thing.Serviced方法的具体用法?C# Thing.Serviced怎么用?C# Thing.Serviced使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thing
的用法示例。
在下文中一共展示了Thing.Serviced方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBob
static User CreateBob()
{
User bob = new User {
Username = "Bob",
Hash = new Byte[] { 0, 1, 2, 3, 4, 5 },
Salt = new Byte[] { 6, 7, 8, 9, 10, 0xA }
#if ENTITY
,Things = new HashSet<Thing>()
#endif
};
Thing camery;
bob.Things.Add(camery = new Thing {
Owner = bob,
Name = "1992 Toyota Camery"
#if ENTITY
,Events = new List<Event>()
#endif
});
Work changeOil = new Work {
Name = "Oil Change",
EveryCounter = 3000
#if ENTITY
,Instances = new List<Event>()
#endif
};
Work changeAlternator = new Work {
Name = "Alternator Change"
#if ENTITY
,Instances = new List<Event>()
#endif
};
camery.Serviced(new Event {
Name = "Serviced at Roger's",
Date = DateTime.Now.Date,
Counter = 100005
#if ENTITY
,WorkDone = new List<Work>()
#endif
})
.HadWorkDown(changeOil)
.HadWorkDown(changeAlternator);
return bob;
}