private static XmlSerializer GetSerializer <T>()
 {
     Activity.GetAllActivities();
     return(new XmlSerializer(typeof(T),
                              AppDomain.CurrentDomain.GetAssemblies().SelectMany(
                                  x => x.GetTypes())
                              .Where(t =>
                                     typeof(Node).IsAssignableFrom(t) ||
                                     typeof(Port).IsAssignableFrom(t) ||
                                     typeof(Activity).IsAssignableFrom(t)).ToArray()));
 }
Exemple #2
0
 public static Activity CreateInstance(string activityId)
 {
     if (Activity.GetAllActivities().Where(x => x.FullName == activityId).FirstOrDefault() is Type activityType)
     {
         return(Activator.CreateInstance(activityType) as Activity);
     }
     else
     {
         throw new TypeLoadException(string.Format("Cannot create instance of '{0}' activity", activityId));
     }
 }
Exemple #3
0
        public static Activity CreateInstance(string name)
        {
            var activityType = Activity.GetAllActivities().Where(x => x.FullName == name).First();

            return(Activator.CreateInstance(activityType) as Activity);
        }