private static void PopulatePSComputerName(ActivityImplementationContext implementationContext, NativeActivityContext context, PSActivityArgumentInfo field, int index) { PropertyInfo property = implementationContext.GetType().GetProperty(field.Name); string[] strArrays = (string[])field.Value.Get(context); string[] strArrays1 = new string[1]; strArrays1[0] = strArrays[index]; property.SetValue(implementationContext, strArrays1, null); }
protected IEnumerable<PSActivityArgumentInfo> GetActivityArguments() { for (Type i = base.GetType(); i != null; i = null) { if (i.IsAbstract) { PropertyInfo[] properties = i.GetProperties(); for (int j = 0; j < (int)properties.Length; j++) { PropertyInfo propertyInfo = properties[j]; if (typeof(Argument).IsAssignableFrom(propertyInfo.PropertyType)) { Argument value = (Argument)propertyInfo.GetValue(this, null); PSActivityArgumentInfo pSActivityArgumentInfo = new PSActivityArgumentInfo(); pSActivityArgumentInfo.Name = propertyInfo.Name; pSActivityArgumentInfo.Value = value; yield return pSActivityArgumentInfo; } } } i = i.BaseType; if (typeof(PSActivity).IsAssignableFrom(i)) { continue; } } }