Beispiel #1
0
        /// <summary>
        /// TODO
        /// This should return a reference to itself to enable chaining when building up argument sets
        /// </summary>
        public static IBuildCallArgumentProviders RefIfArray(this IBuildCallArgumentProviders source, object target, params IBuildCallArgumentProviders[] argumentProviderBuilders)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            if (argumentProviderBuilders == null)
            {
                throw new ArgumentNullException("argumentProviders");
            }

            var argumentProviders = argumentProviderBuilders.Select(b => (b == null) ? null : b.GetArgs()).ToArray();

            if (argumentProviders.Any(p => p == null))
            {
                throw new ArgumentException("Null reference encountered in argumentProviderBuilders set");
            }

            return(source.RefIfArray(target, argumentProviders));
        }
Beispiel #2
0
        public static object CALL(this IAccessValuesUsingVBScriptRules source, object context, object target, string member1, string member2, string member3, string member4, string member5, IBuildCallArgumentProviders argumentProviderBuilder)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (argumentProviderBuilder == null)
            {
                throw new ArgumentNullException("argumentProviderBuilder");
            }

            return(source.CALL(context, target, new[] { member1, member2, member3, member4, member5 }, argumentProviderBuilder.GetArgs()));
        }
Beispiel #3
0
        public static void SET(this IAccessValuesUsingVBScriptRules source, object valueToSetTo, object context, object target, string optionalMemberAccessor, IBuildCallArgumentProviders argumentProviderBuilder)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (argumentProviderBuilder == null)
            {
                throw new ArgumentNullException("argumentProviderBuilder");
            }

            source.SET(valueToSetTo, context, target, optionalMemberAccessor, argumentProviderBuilder.GetArgs());
        }
Beispiel #4
0
        // Convenience methods so that the calling code can omit the "GetArgs" call if an IBuildCallArgumentProviders is already available (results in shorter
        // translated code)
        public static object CALL(this IAccessValuesUsingVBScriptRules source, object context, object target, IEnumerable <string> members, IBuildCallArgumentProviders argumentProviderBuilder)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (argumentProviderBuilder == null)
            {
                throw new ArgumentNullException("argumentProviderBuilder");
            }

            return(source.CALL(context, target, members, argumentProviderBuilder.GetArgs()));
        }