예제 #1
0
        public IEnumerable <KeyValuePair <string, object> > GetAllArguments()
        {
            if (StageSpecificArguments != null)
            {
                foreach (var kvp in StageSpecificArguments.ToDictionary())
                {
                    yield return(kvp);
                }
            }

            foreach (IArgument argument in Arguments)
            {
                yield return(new KeyValuePair <string, object>(argument.Name, argument.GetValueAsSystemType()));
            }
        }
예제 #2
0
        public void IterateAllArguments(Func <string, object, bool> func)
        {
            foreach (var arg in Arguments)
            {
                func(arg.Name, arg.GetValueAsSystemType());
            }

            if (StageSpecificArguments == null)
            {
                return;
            }

            foreach (var arg in StageSpecificArguments.ToDictionary())
            {
                func(arg.Key, arg.Value);
            }
        }
예제 #3
0
        public IEnumerable <KeyValuePair <string, T> > GetAllArgumentsOfType <T>()
        {
            if (StageSpecificArguments != null)
            {
                foreach (var kvp in StageSpecificArguments.ToDictionary())
                {
                    if (kvp.Value.GetType() == typeof(T))
                    {
                        yield return(new KeyValuePair <string, T>(kvp.Key, (T)kvp.Value));
                    }
                }
            }

            foreach (IArgument argument in Arguments)
            {
                if (argument.GetSystemType() == typeof(T))
                {
                    yield return(new KeyValuePair <string, T>(argument.Name, (T)argument.GetValueAsSystemType()));
                }
            }
        }