示例#1
0
 static void RegisterOperations <T>() where T : Entity
 {
     if (OperationLogic.TryFindOperation(typeof(T), DisableOperation.Disable.Symbol) == null)
     {
         new Graph <T> .Execute(DisableOperation.Disable)
         {
             CanExecute = e => e.Mixin <DisabledMixin>().IsDisabled ? ValidationMessage._0IsSet.NiceToString(ReflectionTools.GetPropertyInfo((DisabledMixin m) => m.IsDisabled).NiceName()) : null,
             Execute    = (e, _) => { e.Mixin <DisabledMixin>().IsDisabled = true; },
         }
     }