Skip to content

Commit

Permalink
Fixed assembly exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvux committed Oct 3, 2011
1 parent 7004733 commit 90bd943
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions VVVV/VVVV.CV.Factories/StreamProcessorFactory.cs
Expand Up @@ -181,30 +181,42 @@ protected override IEnumerable<INodeInfo> LoadNodeInfos(string filename)

protected void LoadNodeInfosFromFile(string filename, string sourcefilename, ref List<INodeInfo> nodeInfos, bool commitUpdates)
{
var assembly = Assembly.LoadFrom(filename);

this.filterlocator.Scan(assembly);

foreach (string key in this.filterlocator.RegisteredTypes.Keys)
Assembly assembly = null;
try
{
assembly = Assembly.LoadFrom(filename);
} catch
{
Type t = this.filterlocator.RegisteredTypes[key];
var nodeInfo = FNodeInfoFactory.CreateNodeInfo(key, "Imaging", String.Empty, filename, true);
nodeInfo.Arguments = Assembly.GetExecutingAssembly().Location.ToLower();
nodeInfo.Factory = this;
nodeInfo.Type = NodeType.Plugin;
nodeInfo.UserData = t;
nodeInfo.CommitUpdate();
nodeInfo.UserData = t;
nodeInfo.AutoEvaluate = true;
nodeInfos.Add(nodeInfo);
assembly = null;
}

foreach (var nodeInfo in nodeInfos)
if (assembly != null)
{
nodeInfo.Factory = this;
if (commitUpdates)
this.filterlocator.Scan(assembly);

foreach (string key in this.filterlocator.RegisteredTypes.Keys)
{
Type t = this.filterlocator.RegisteredTypes[key];
var nodeInfo = FNodeInfoFactory.CreateNodeInfo(key, "Imaging", String.Empty, filename, true);
nodeInfo.Arguments = Assembly.GetExecutingAssembly().Location.ToLower();
nodeInfo.Factory = this;
nodeInfo.Type = NodeType.Plugin;
nodeInfo.UserData = t;
nodeInfo.CommitUpdate();
nodeInfo.UserData = t;
nodeInfo.AutoEvaluate = true;
nodeInfos.Add(nodeInfo);
}

foreach (var nodeInfo in nodeInfos)
{
nodeInfo.Factory = this;
if (commitUpdates)
nodeInfo.CommitUpdate();
}
}


}
#endregion

Expand Down

0 comments on commit 90bd943

Please sign in to comment.