本文整理汇总了C#中Term.IsNot方法的典型用法代码示例。如果您正苦于以下问题:C# Term.IsNot方法的具体用法?C# Term.IsNot怎么用?C# Term.IsNot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Term
的用法示例。
在下文中一共展示了Term.IsNot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
private bool Delete(Term target, bool trying, Action<IEnumerable<Term>> callback)
{
if (target.Is<IImmutableTerm>() || (target.Locked && target.IsNot<AbsentEvent>())) return false;
Term[] coverdTerms;
if (target.IsNew()) // unsaved term deleting
coverdTerms = GetCoveredTermsWithAbsent(target).Where(o => o.Id == 0).ToArray();
else
coverdTerms = GetCoveredTermsWithAbsent(target).ToArray();
if (coverdTerms.Any(t => !(t is AbsentEvent) && t.Locked)) return false; // 有任何请假不准删除
if (coverdTerms.Length != GetDeletableCoveredTerms(target).Count()) return false;
if (trying) return true;
bool result;
List<Term> deletedTerms;
if (coverdTerms.Length == 0)
{
result = _termSet.Remove(target);
deletedTerms = new List<Term>(new[] { target });
}
else
{
result = _termSet.RemoveAll(coverdTerms) && _termSet.Remove(target);
deletedTerms = new List<Term>(coverdTerms) { target };
}
if (result)
{
if (target.IsNot<IAssignment>())
Reporting(target);
EmptySeatArrangment<AbsentEvent>(target);
if (callback != null)
callback(deletedTerms);
}
return result;
}