Exemple #1
0
 public static void GetDataTypeString(DataType obj, Zetbox.API.MethodReturnEventArgs <string> e)
 {
     if (obj.Module == null)
     {
         e.Result = obj.Name;
     }
     else
     {
         e.Result = obj.Module.Namespace + "." + obj.Name;
     }
 }
Exemple #2
0
 public static void ToString(NotNullableConstraint obj, Zetbox.API.MethodReturnEventArgs <string> e)
 {
     if (obj.ConstrainedProperty == null)
     {
         e.Result = String.Format("The ConstrainedProperty should not be NULL");
     }
     else
     {
         e.Result = String.Format("{0} should not be NULL", obj.ConstrainedProperty.Name);
     }
 }
Exemple #3
0
        public static void ToString(StringRangeConstraint obj, Zetbox.API.MethodReturnEventArgs <string> e)
        {
            string maxLength = obj.MaxLength != null?obj.MaxLength.ToString() : "unlimited";

            // Only display min if there is an actual restriction.
            if (obj.MinLength > 0)
            {
                e.Result = String.Format("{0} should have at least {1} and at most {2} characters",
                                         obj.ConstrainedProperty == null
                        ? "a property"
                        : obj.ConstrainedProperty.Name,
                                         obj.MinLength,
                                         maxLength);
            }
            else
            {
                e.Result = String.Format("{0} should have at most {1} characters",
                                         obj.ConstrainedProperty == null
                        ? "a property"
                        : obj.ConstrainedProperty.Name,
                                         maxLength);
            }
        }
Exemple #4
0
 public static void ToString(IsValidIdentifierConstraint obj, Zetbox.API.MethodReturnEventArgs <string> e)
 {
     e.Result = "Method names, property names, enum names etc. must be valid names.";
 }
Exemple #5
0
 public static void GetPropertyTypeString(Zetbox.App.Base.Property obj, Zetbox.API.MethodReturnEventArgs <string> e)
 {
     e.Result = "<Invalid Datatype, please implement Property.GetPropertyTypeString()>";
 }