예제 #1
0
        static IEnumerable <Error> checkUnityEvent(
            IErrorFactory errorFactory, FieldHierarchyStr fieldHierarchy, UnityEventBase evt
            )
        {
            UnityEventReflector.rebuildPersistentCallsIfNeeded(evt);

            var persistentCalls       = evt.__persistentCalls();
            var listPersistentCallOpt = persistentCalls.calls;

            foreach (var listPersistentCall in listPersistentCallOpt)
            {
                var index = 0;
                foreach (var persistentCall in listPersistentCall)
                {
                    if (persistentCall.isValid)
                    {
                        if (evt.__findMethod(persistentCall).isNone)
                        {
                            yield return(errorFactory.unityEventInvalidMethod(fieldHierarchy, index));
                        }
                    }
                    else
                    {
                        yield return(errorFactory.unityEventInvalid(fieldHierarchy, index));
                    }

                    index++;
                }
            }
        }
예제 #2
0
 public static Error customValidationException(
     Object o, FieldHierarchyStr hierarchy, Exception exception, CheckContext context
     ) => new Error(
     Type.CustomValidationException,
     $"{context}. Property: {hierarchy.s}. Error while running {nameof(OnObjectValidate)}:\n{exception}",
     o
     );
예제 #3
0
 public static Error emptyCollection(
     Object o, FieldHierarchyStr hierarchy, CheckContext context
     ) => new Error(
     Type.EmptyCollection,
     $"{context}. Property: {hierarchy.s}",
     o
     );
예제 #4
0
 public static Error customError(
     Object o, FieldHierarchyStr hierarchy, ErrorMsg error, CheckContext context, bool useErrorMessageContext
     ) => new Error(
     Type.CustomValidation,
     $"{context}. Property: {hierarchy.s}. Error: {error}",
     useErrorMessageContext ? error.context.getOrElse(o) : o
     );
예제 #5
0
 public static Error badTextFieldTag(
     Object o, FieldHierarchyStr hierarchy, CheckContext context
     ) => new Error(
     Type.TextFieldBadTag,
     $"{context}. Property: {hierarchy.s}",
     o
     );
예제 #6
0
 public static Error nullReference(
     Object o, FieldHierarchyStr hierarchy, CheckContext context
     ) => new Error(
     Type.NullReference,
     $"{context}. Property: {hierarchy.s}",
     o
     );
예제 #7
0
 public static Error customError(
     Object o, FieldHierarchyStr hierarchy, ErrorMsg error, CheckContext context
     ) => new Error(
     Type.CustomValidation,
     $"{context}. Property: {hierarchy.s}. Error: {error}",
     o
     );
예제 #8
0
 public static Error unityEventInvalid(
     Object o, FieldHierarchyStr hierarchy, int index, CheckContext context
     ) => new Error(
     Type.UnityEventInvalid,
     $"{unityEventMessagePrefix(hierarchy.s, index)} is not valid " +
     unityEventMessageSuffix(context),
     o
     );
 public Error custom(FieldHierarchyStr hierarchy, ErrorMsg customErrorMessage, bool useErrorMessageContext) =>
 Error.customError(o: component, hierarchy: hierarchy, error: customErrorMessage, context: context, useErrorMessageContext);
예제 #10
0
 public Error exceptionInCustomValidator(FieldHierarchyStr hierarchy, Exception exception) =>
 Error.customValidationException(o: component, hierarchy: hierarchy, exception: exception, context: context);
예제 #11
0
 public Error unityEventInvalidMethod(FieldHierarchyStr hierarchy, int index) =>
 Error.unityEventInvalidMethod(o: component, hierarchy: hierarchy, index: index, context: context);
예제 #12
0
 public Error badTextFieldTag(FieldHierarchyStr hierarchy) =>
 Error.badTextFieldTag(o: component, hierarchy: hierarchy, context: context);
예제 #13
0
 public Error emptyString(FieldHierarchyStr hierarchy) =>
 Error.emptyString(o: component, hierarchy: hierarchy, context: context);
예제 #14
0
 public Error emptyCollection(FieldHierarchyStr hierarchy) =>
 Error.emptyCollection(o: component, hierarchy: hierarchy, context: context);
예제 #15
0
 public Error nullField(FieldHierarchyStr hierarchy) =>
 Error.nullReference(o: component, hierarchy: hierarchy, context: context);