aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/NewFileCollection_16x.png
blob: bc5cef8284c18f29239d85481d544ecc0a6a842f (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 10 00 00 00 10 08 06 00 00 00 1f f3 ff .PNG........IHDR................
0020 61 00 00 00 04 67 41 4d 41 00 00 b1 8f 0b fc 61 05 00 00 00 09 70 48 59 73 00 00 0e c2 00 00 0e a....gAMA......a.....pHYs.......
0040 c2 01 15 28 4a 80 00 00 00 18 74 45 58 74 53 6f 66 74 77 61 72 65 00 70 61 69 6e 74 2e 6e 65 74 ...(J.....tEXtSoftware.paint.net
0060 20 34 2e 31 2e 36 fd 4e 09 e8 00 00 00 89 49 44 41 54 38 4f ad 90 d1 0d 80 20 0c 44 9d c3 29 9c .4.1.6.N......IDAT8O.......D..).
0080 cf c4 e1 74 21 ff f8 ad 1c e6 6a 69 04 c1 d0 e4 49 2d bd 67 e2 64 4b 44 94 96 d2 3d 1b 3c b6 39 ...t!.....ji....
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace Tango.MachineStudio.Common.ValidationRules
{
    /// <summary>
    /// Represents a required field validation rule.
    /// </summary>
    /// <seealso cref="System.Windows.Controls.ValidationRule" />
    public class Required : ValidationRule
    {
        /// <summary>
        /// When overridden in a derived class, performs validation checks on a value.
        /// </summary>
        /// <param name="value">The value from the binding target to check.</param>
        /// <param name="cultureInfo">The culture to use in this rule.</param>
        /// <returns>
        /// A <see cref="T:System.Windows.Controls.ValidationResult" /> object.
        /// </returns>
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            return new ValidationResult(!String.IsNullOrWhiteSpace(value.ToStringSafe()), "Required");
        }
    }
}