Skip to content

Commit

Permalink
Removing references to old WWF classes. Fixes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
shytikov committed Aug 15, 2016
1 parent af32a0a commit eb06f6e
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions Xrm.Sdk.PluginRegistration/AssemblyReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Xrm.Sdk.PluginRegistration
using Helpers;
using Microsoft.Xrm.Sdk;
using System;
using System.Activities;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -104,39 +105,14 @@ public CrmPluginAssembly RetrievePluginsFromAssembly(string path)
//It may be that the version of Microsoft.Crm.Sdk.dll will be the v5 version, but it will still be a v4 plug-in.
sdkVersion = new Version(4, 0);
}
else if (t.IsSubclassOf(typeof(System.Workflow.ComponentModel.Activity)) || t.IsSubclassOf(typeof(System.Activities.Activity)))
else if (t.IsSubclassOf(typeof(CodeActivity)) || t.IsSubclassOf(typeof(Activity)))
{
//Checking whether the Custom Activity descends from Activity will save time, because it
//would most likely fail at run-time since the Workflow engine would not know how to handle the class

type = CrmPluginType.WorkflowActivity;
isolatable = CrmPluginIsolatable.No;

if (t.IsSubclassOf(typeof(System.Workflow.ComponentModel.Activity)))
{
errorMessage = string.Format("The Custom Workflow Activity {0} class must have the CrmWorkflowActivity attribute set", t.FullName);

//Verify that the Workflow attribute is present.
foreach (Attribute att in t.GetCustomAttributes(true))
{
if (att != null && (att.GetType().FullName == "Microsoft.Crm.Workflow.CrmWorkflowActivityAttribute"))
{
dynamic attribute = att;
workflowGroupName = attribute.GroupName;
pluginName = attribute.Name;

if (string.IsNullOrEmpty(pluginName))
{
errorMessage = string.Format("The Custom Workflow Activity {0} class's CrmWorkflowActivity attribute must have the Name property set", t.FullName);
}
else
{
errorMessage = null;
}
break;
}
}
}
isolatable = CrmPluginIsolatable.Yes;
sdkVersion = xrmPlugin.Assembly.GetName().Version;
}
else
{
Expand Down

0 comments on commit eb06f6e

Please sign in to comment.