コード例 #1
0
 public override bool ShouldChangeCharacters(UITextField textField, Foundation.NSRange range, string replacementString)
 {
     if (replacementString == "-" && textField.Text.Length > 0)
     {
         return(true);
     }
     if (replacementString == " " && textField.Text.Length == 0)
     {
         return(false);
     }
     if (replacementString.Length > 1)
     {
         return(false);
     }
     if (!string.IsNullOrEmpty(replacementString) && Char.IsDigit(Char.Parse(replacementString)) && textField.Text.Length == 0)
     {
         return(false);
     }
     if (!string.IsNullOrEmpty(replacementString) && !(replacementString == " " || Char.IsLetterOrDigit(Char.Parse(replacementString))))
     {
         return(false);
     }
     if ((replacementString + textField.Text).Length > 40)
     {
         return(false);
     }
     return(true);
 }
コード例 #2
0
        public override bool ShouldChangeCharacters(UITextField textField, Foundation.NSRange range, string replacementString)
        {
            NSString original    = NSObject.FromObject(textField.Text) as NSString;
            NSString replacement = NSObject.FromObject(replacementString) as NSString;
            NSString updated     = original.Replace(range, replacement);

            var result = Validator.ValidateFloat(updated);

            return(result == Validator.ValidationResult.Intermediate || result == Validator.ValidationResult.Valid);
        }
コード例 #3
0
        public bool ShouldChangeCharacters(UITextField textField, Foundation.NSRange range, string replacementString)
        {
            var newLength = textField.Text.Length + replacementString.Length - range.Length;

            var text         = textField.Text;
            var result       = text.Substring(0, (int)range.Location) + replacementString + text.Substring((int)(range.Location + range.Length));
            var shouldChange = newLength <= 21;

            if (shouldChange)
            {
                formatText(result);
            }
            return(newLength <= 21);
        }
コード例 #4
0
 public bool ShouldChangeCharacters(UITextField textField, Foundation.NSRange range, string replacementString)
 {
     Debug.WriteLine(textField.Text);
     return(true);
 }
コード例 #5
0
		public virtual void SetTemporaryAttributes (Foundation.NSDictionary<Foundation.NSString,Foundation.NSObject> attributes, Foundation.NSRange characterReange)
			=> throw new NotSupportedException ();
コード例 #6
0
 public bool ShouldChangeCharacters(UITextField textField, Foundation.NSRange range, string replacementString)
 {
     return(Validations.ValidateText(replacementString));
 }
コード例 #7
0
 public static NSTextCheckingResult DateCheckingResultWithRange(NSRange range, NSDate date, NSTimeZone timeZone, NSTimeInterval duration)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #8
0
 public static NSTextCheckingResult TransitInformationCheckingResultWithRange(NSRange range, Dictionary <NSObject, AnyObject> components)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #9
0
 public static NSTextCheckingResult PhoneNumberCheckingResultWithRange(NSRange range, string phoneNumber)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #10
0
 public static NSTextCheckingResult ReplacementCheckingResultWithRange(NSRange range, string replacementString)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #11
0
 public static NSTextCheckingResult LinkCheckingResultWithRange(NSRange range, NSURL URL)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #12
0
 public static NSTextCheckingResult GrammarCheckingResultWithRange(NSRange range, AnyObject[] details)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #13
0
 public static NSTextCheckingResult OrthographyCheckingResultWithRange(NSRange range, NSOrthography orthography)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #14
0
 public static NSTextCheckingResult SpellCheckingResultWithRange(NSRange range)
 {
     return(default(NSTextCheckingResult));
 }
コード例 #15
0
 public bool ShouldChangeCharacters(UITextField textField, Foundation.NSRange range, string replacementString)
 {
     return(Validations.ValidateInput(replacementString, Validations.ValidationType.Password));
 }
コード例 #16
0
        public virtual bool IsPartialStringValid(out string partialString, out NSRange proposedSelRange, string origString, NSRange origSelRange, out NSString error)
        {
            partialString    = origString;
            proposedSelRange = origSelRange;
            error            = null;

            return(true);
        }
コード例 #17
0
 public unsafe static void SetBuffers(this IMTLArgumentEncoder This, IMTLBuffer [] buffers, nint [] offsets, Foundation.NSRange range)
 {
     fixed(void *handle = offsets)
     This.SetBuffers(buffers, (IntPtr)handle, range);
 }
コード例 #18
0
 public static NSTextCheckingResult DateCheckingResultWithRange(NSRange range, NSDate date)
 {
     return(default(NSTextCheckingResult));
 }