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; } }
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); } }
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); } }
public static void ToString(IsValidIdentifierConstraint obj, Zetbox.API.MethodReturnEventArgs <string> e) { e.Result = "Method names, property names, enum names etc. must be valid names."; }
public static void GetPropertyTypeString(Zetbox.App.Base.Property obj, Zetbox.API.MethodReturnEventArgs <string> e) { e.Result = "<Invalid Datatype, please implement Property.GetPropertyTypeString()>"; }