예제 #1
0
        /// <summary>
        /// Matches the specified regular expression pattern.
        /// </summary>
        /// <typeparam name="TViewModel">The type of the view model.</typeparam>
        /// <typeparam name="TPropertyValue">The type of the property value.</typeparam>
        /// <param name="instance">The instance.</param>
        /// <param name="pattern">The pattern.</param>
        /// <returns></returns>
        public static IFluentContinuation <TViewModel, TPropertyValue> Matching <TViewModel, TPropertyValue>(
            this IFluentOperator <TViewModel, TPropertyValue> instance, string pattern)
            where TViewModel : ViewModelBase
            where TPropertyValue : IComparable <string>, IEquatable <string>
        {
            var implementerInstance = (FluentImplementer <TViewModel, TPropertyValue>)instance;

            implementerInstance.EnsureContextCurrentPropertyIsNotNull();

            implementerInstance.AddToken(ExpressionNode.MatchingProperty(implementerInstance.Context.CurrentProperty, pattern));
            return((IFluentContinuation <TViewModel, TPropertyValue>)instance);
        }