/// <summary> /// Gets all the fields for a specific activity /// </summary> /// <param name="activity">The activity that the fields will be retrieved from</param> /// <returns>Returns all the fields in a list of strings</returns> public List <string> GetActivityFields(object activity) { List <string> results = new List <string>(); Dev2FindMissingStrategyFactory stratFac = new Dev2FindMissingStrategyFactory(); DsfSequenceActivity sequenceActivity = activity as DsfSequenceActivity; if (sequenceActivity != null) { foreach (var innerActivity in sequenceActivity.Activities) { IDev2Activity dsfActivityAbstractString = innerActivity as IDev2Activity; if (dsfActivityAbstractString != null) { GetResults(dsfActivityAbstractString, stratFac, results); } } } IEnumerable <PropertyInfo> properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(activity); // ReSharper disable LoopCanBeConvertedToQuery foreach (PropertyInfo propertyInfo in properties) // ReSharper restore LoopCanBeConvertedToQuery { object property = propertyInfo.GetValue(activity, null); if (property != null) { results.Add(property.ToString()); } } return(results); }
/// <summary> /// Gets all the fields for a specific activity /// </summary> /// <param name="activity">The activity that the fields will be retrieved from</param> /// <returns>Returns all the fields in a list of strings</returns> public List <string> GetActivityFields(object activity) { var results = new List <string>(); var stratFac = new Dev2FindMissingStrategyFactory(); if (activity is DsfSequenceActivity sequenceActivity) { foreach (var innerActivity in sequenceActivity.Activities) { if (innerActivity is IDev2Activity dsfActivityAbstractString) { GetResults(dsfActivityAbstractString, stratFac, results); } } } var properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(activity); foreach (PropertyInfo propertyInfo in properties) { var property = propertyInfo.GetValue(activity, null); if (property != null) { results.Add(property.ToString()); } } return(results); }
/// <summary> /// Gets all the fields for a specific activity /// </summary> /// <param name="activity">The activity that the fields will be retrieved from</param> /// <returns>Returns all the fields in a list of strings</returns> public List <string> GetActivityFields(object activity) { List <string> results = new List <string>(); IEnumerable <PropertyInfo> properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(activity); foreach (PropertyInfo propertyInfo in properties) { object property = propertyInfo.GetValue(activity, null); if (property != null) { results.Add(property.ToString()); } } return(results); }
private IList <string> InternalFindMissing <T>(IEnumerable <T> data) { IList <string> results = new List <string>(); foreach (T row in data) { IEnumerable <PropertyInfo> properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(row); foreach (PropertyInfo propertyInfo in properties) { object property = propertyInfo.GetValue(row, null); if (property != null) { results.Add(property.ToString()); } } } return(results); }
/// <summary> /// Gets all the fields for a specific activity /// </summary> /// <param name="activity">The activity that the fields will be retrieved from</param> /// <returns>Returns all the fields in a list of strings</returns> public List <string> GetActivityFields(object activity) { List <string> results = new List <string>(); Dev2FindMissingStrategyFactory stratFac = new Dev2FindMissingStrategyFactory(); DsfForEachActivity forEachActivity = activity as DsfForEachActivity; if (forEachActivity != null) { IFindMissingStrategy strategy; enFindMissingType findMissingType; var boolAct = forEachActivity.DataFunc.Handler as DsfNativeActivity <bool>; if (boolAct == null) { DsfNativeActivity <string> stringAct = forEachActivity.DataFunc.Handler as DsfNativeActivity <string>; if (stringAct != null) { findMissingType = stringAct.GetFindMissingType(); strategy = stratFac.CreateFindMissingStrategy(findMissingType); results.AddRange(strategy.GetActivityFields(stringAct)); } } else { findMissingType = boolAct.GetFindMissingType(); strategy = stratFac.CreateFindMissingStrategy(findMissingType); results.AddRange(strategy.GetActivityFields(boolAct)); } } IEnumerable <PropertyInfo> properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(activity); foreach (PropertyInfo propertyInfo in properties) { object property = propertyInfo.GetValue(activity, null); if (property != null) { results.Add(property.ToString()); } } return(results); }
private static IEnumerable <string> InternalFindMissing <T>(IEnumerable <T> data) { IList <string> results = new List <string>(); // ReSharper disable LoopCanBeConvertedToQuery foreach (T row in data) // ReSharper restore LoopCanBeConvertedToQuery { IEnumerable <PropertyInfo> properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(row); foreach (PropertyInfo propertyInfo in properties) { object property = propertyInfo.GetValue(row, null); if (property != null) { results.Add(property.ToString()); } } } return(results); }
/// <summary> /// Gets all the fields for a specific activity /// </summary> /// <param name="activity">The activity that the fields will be retrieved from</param> /// <returns>Returns all the fields in a list of strings</returns> public List <string> GetActivityFields(object activity) { var results = new List <string>(); var stratFac = new Dev2FindMissingStrategyFactory(); if (activity is SuspendExecutionActivity suspendExecutionActivity) { IFindMissingStrategy strategy; enFindMissingType findMissingType; var boolAct = suspendExecutionActivity.SaveDataFunc.Handler as DsfNativeActivity <bool>; if (boolAct == null) { if (suspendExecutionActivity.SaveDataFunc.Handler is DsfNativeActivity <string> stringAct) { findMissingType = stringAct.GetFindMissingType(); strategy = stratFac.CreateFindMissingStrategy(findMissingType); results.AddRange(strategy.GetActivityFields(stringAct)); } } else { findMissingType = boolAct.GetFindMissingType(); strategy = stratFac.CreateFindMissingStrategy(findMissingType); results.AddRange(strategy.GetActivityFields(boolAct)); } } var properties = StringAttributeRefectionUtils.ExtractAdornedProperties <FindMissingAttribute>(activity); foreach (PropertyInfo propertyInfo in properties) { var property = propertyInfo.GetValue(activity, null); if (property != null) { results.Add(property.ToString()); } } return(results); }