by
0
6
1,351
0
Top 1% !
Famous
Easy-to-find
Specified
Refined
OpenSource
Popularity: 21441st place

Published on:

InputName0activity
InputType0ActivityBase
LanguageCSharp
LicenseMIT_X11
MethodNameGetActivityData
OSWindows
OutputTypeobject[]

GetActivityData: Converts the collection of activity data items into a flat array.

<summary>
Converts the collection of activity data items into a flat array.
</summary>
<param name="activity">The activity supplying data items.</param>
<returns>An array containing activity item names and their values or a null reference if the specified activity doesn't contain any data items.</returns>
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/287967/GetActivityData--Converts-the-collection?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
/// <summary> /// Converts the collection of activity data items into a flat array. /// </summary> /// <param name="activity">The activity supplying data items.</param> /// <returns>An array containing activity item names and their values or a null reference if the specified activity doesn't contain any data items.</returns> public static object[] GetActivityData(ActivityBase activity) { Guard.ArgumentNotNull(activity, "activity"); IDictionary<string, object> activityData = activity.ActivityData; if (activityData != null) { ArrayList props = new ArrayList(activityData.Count * 2); foreach (KeyValuePair<string, object> activityItem in activityData) { props.Add(activityItem.Key); props.Add(activityItem.Value); } return props.ToArray(); } else { return null; } }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus