by
0
6
121k
0
Top 1% !
Pearl of Wisdom
Easy-to-find
Specified
Refined
OpenSource
Popularity: 17483rd place

Published on:

InputName0path
InputType0string
LanguageCSharp
LicenseMIT_X11
MethodNameGetActivity
OSWindows
OutputTypeDynamicActivity

GetActivity: Returns the requested activity from the cache. If not found, loads the activity from the supplied path, caches it and returns the activity.

<summary>
Returns the requested activity from the cache. If not found, loads the activity from the supplied path, caches it and returns the activity.
</summary>
<param name="path">The path which is the unique identifier of the required activity.</param>
<returns>The requested activity.</returns>
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/293823/GetActivity--Returns-the-requested-activ?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> /// A thread safe dictionary holding DynamicActivity instances keyed by their file path (environment vars unresolved). /// </summary> private static IDictionary<string, DynamicActivity> activityDictionary = new ThreadSafeDictionary<string, DynamicActivity>(); /// <summary> /// Returns the requested activity from the cache. If not found, loads the activity from the supplied path, caches it and returns the activity. /// </summary> /// <param name="path">The path which is the unique identifier of the required activity.</param> /// <returns>The requested activity.</returns> public static DynamicActivity GetActivity(string path) { DynamicActivity dynamicActivity = null; if (!activityDictionary.TryGetValue(path, out dynamicActivity)) { dynamicActivity = ActivityXamlServices.Load(ReplaceEnvironmentVariables(path)) as DynamicActivity; activityDictionary[path] = dynamicActivity; } return dynamicActivity; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus