本文整理汇总了C#中Term.UpdateLevel方法的典型用法代码示例。如果您正苦于以下问题:C# Term.UpdateLevel方法的具体用法?C# Term.UpdateLevel怎么用?C# Term.UpdateLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Term
的用法示例。
在下文中一共展示了Term.UpdateLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
//public virtual void CreateOffWork(Term newTerm, Action<ITerm, bool> callback)
//{
// var foundTerms = TermSet.Retrieve<Term>(newTerm.Start, newTerm.End, o => o.Is<IIndependenceTerm>());
// var filteredTerms = foundTerms.Where(t => t.IsCoverd(newTerm.Start, newTerm.End)).OrderBy(o=> o.Start);
// var success = CreateValidations[newTerm.GetType()].Invoke(this, newTerm, filteredTerms);
// if (success)
// {
// _termSet.Add(newTerm);
// newTerm.UpdateLevel();
// newTerm.SetEmployeeId(Id);
// }
// callback(newTerm, success);
//}
public virtual void Create(Term newTerm, Action<ITerm, bool> callback, bool withRplaceDayOff)
{
//var success = false;
//var closestBottomTerm = GetOrderedBottoms(newTerm).FirstOrDefault();
//if (closestBottomTerm == null || !closestBottomTerm.Locked)
//{
//TODO: reconsider OrderBy clause
var foundTerms = TermSet.Retrieve<Term>(newTerm.Start, newTerm.End, o => o.IsNot<IImmutableTerm>());
var filteredTerms = foundTerms.Where(t => t.IsCoverd(newTerm.Start, newTerm.End)).OrderByDescending(o => o.Level);
var success = CreateValidations[newTerm.GetType()].Invoke(this, newTerm, filteredTerms);
//set up belongToPrev
//xnewTerm.RectifyAttribution(Boundary, newTerm.Start);
//temporary remark with IsOutOfBoundary limit
//if (success && newTerm.IsNot<IOffWork>())
//{
// var lowestTerm = newTerm.GetLowestTerm();
// success = !lowestTerm.IsOutOfBoundary(lowestTerm.Start, this);
//}
if (!success && newTerm.Exception != null && withRplaceDayOff && newTerm.Exception.CauseTarget is DayOff)
success = Delete(newTerm.Exception.CauseTarget, false);
if (success)
{
_termSet.Add(newTerm);
newTerm.UpdateLevel();
newTerm.SetEmployeeId(Id);
//xnewTerm.ForceAssignSeat(foundTerms, true);
Reporting(newTerm);
//xEmptySeatArrangment<AbsentEvent>(newTerm);
}
callback(newTerm, success);
}