1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
5 namespace System.Activities.Presentation
7 static class ActivityTemplateFactoryExtension
9 public static bool IsActivityTemplateFactory(this Type type)
11 return type.GetInterface(typeof(IActivityTemplateFactory).FullName) != null ||
12 type.GetInterface(typeof(IActivityTemplateFactory<>).FullName) != null;
15 public static bool TryGetActivityTemplateFactory(this Type type, out Type argumentType)
17 if (type.GetInterface(typeof(IActivityTemplateFactory).FullName) != null)
19 // Hard coding here, because we don't want to create instance before dropped. Suggestion is to use IActivityTemplateFactory<> instead.
20 argumentType = typeof(Activity);
24 Type activityFactoryInterfaceType = type.GetInterface(typeof(IActivityTemplateFactory<>).FullName);
25 if (activityFactoryInterfaceType != null)
27 argumentType = activityFactoryInterfaceType.GetGenericArguments()[0];