Beispiel #1
0
        /// <summary>
        /// Retrieves an object that defines the dynamic parameters of this cmdlet.
        /// </summary>
        /// <returns>An object that defines the dynamic parameters of this cmdlet.</returns>
        public object GetDynamicParameters()
        {
            if (dynamicParams == null)
            {
                dynamicParams = new PropertyDynamicParameterSet <TriggerProperty>(ParameterSet.Dynamic, TriggerParameterParser.GetPropertyType, this);
            }

            return(dynamicParams.Parameters);
        }
Beispiel #2
0
        /// <summary>
        /// Retrieves an object that defines the dynamic parameters of this cmdlet.
        /// </summary>
        /// <returns>An object that defines the dynamic parameters of this cmdlet.</returns>
        public object GetDynamicParameters()
        {
            if (dynamicParams == null)
                dynamicParams = new PropertyDynamicParameterSet<ObjectProperty>(
                    new[] {ParameterSet.Dynamic, ParameterSet.DynamicManual },
                    e => ObjectPropertyParser.GetPropertyInfoViaTypeLookup(e).Property.PropertyType
                );

            return dynamicParams.Parameters;
        }
Beispiel #3
0
        public object GetDynamicParameters()
        {
            if (dynamicParams == null)
            {
                dynamicParams = new PropertyDynamicParameterSet <TProperty>(
                    new[] { ParameterSet.Dynamic, ParameterSet.DynamicManual },
                    e => getPropertyType((Enum)(object)e)
                    );
            }

            return(dynamicParams.Parameters);
        }
Beispiel #4
0
        /// <summary>
        /// Retrieves an object that defines the dynamic parameters of this cmdlet.
        /// </summary>
        /// <returns>An object that defines the dynamic parameters of this cmdlet.</returns>
        public object GetDynamicParameters()
        {
            if (dynamicParams == null)
            {
                dynamicParams = new PropertyDynamicParameterSet <ObjectProperty>(
                    ParameterSet.Dynamic,
                    e => ObjectPropertyParser.GetPropertyInfoViaTypeLookup(e).Property.PropertyType
                    );
            }

            return(dynamicParams.Parameters);
        }
Beispiel #5
0
        /// <summary>
        /// Retrieves an object that defines the dynamic parameters of this cmdlet.
        /// </summary>
        /// <returns>An object that defines the dynamic parameters of this cmdlet.</returns>
        public object GetDynamicParameters()
        {
            if (dynamicParameterSet == null)
            {
                var properties = ReflectionCacheManager.Get(typeof(NotificationTrigger)).Properties.
                                 Where(p => p.GetAttribute <PropertyParameterAttribute>() != null).
                                 Select(p => Tuple.Create((TriggerProperty)p.GetAttribute <PropertyParameterAttribute>().Property, p)).ToList();

                dynamicParameterSet = new PropertyDynamicParameterSet <TriggerProperty>(
                    new[] { ParameterSet.Dynamic, ParameterSet.DynamicManual },
                    e => ReflectionCacheManager.GetArrayPropertyType(properties.FirstOrDefault(p => p.Item1 == e)?.Item2.Property.PropertyType),
                    this
                    );
            }

            return(dynamicParameterSet.Parameters);
        }
Beispiel #6
0
        internal object GetDynamicParameters(params string[] parameterSets)
        {
            if (parameterSets.Length == 0)
            {
                parameterSets = new[] { ParameterSet.Dynamic }
            }
            ;

            if (dynamicParameterSet == null)
            {
                var properties = ReflectionCacheManager.Get(typeof(TObject)).Properties.
                                 Where(p => p.GetAttribute <PropertyParameterAttribute>() != null).
                                 Select(p => Tuple.Create((Property)p.GetAttribute <PropertyParameterAttribute>().Property, p)).ToList();

                dynamicParameterSet = new PropertyDynamicParameterSet <Property>(
                    parameterSets,
                    e => ReflectionCacheManager.GetArrayPropertyType(properties.FirstOrDefault(p => p.Item1 == e)?.Item2.Property.PropertyType),
                    this
                    );
            }

            return(dynamicParameterSet.Parameters);
        }