forked from GraphLinq/GraphLinq.Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphManager.cs
More file actions
26 lines (22 loc) · 760 Bytes
/
Copy pathGraphManager.cs
File metadata and controls
26 lines (22 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace NodeBlock.Engine
{
public static class GraphManager
{
private static bool _initialized = false;
public static void InitGraphEngine()
{
if (_initialized) return;
foreach(var type in Assembly.GetExecutingAssembly().GetTypes())
{
if (type.GetCustomAttributes(typeof(Attributes.NodeDefinition), true).Length == 0) continue;
var instance = Activator.CreateInstance(type, string.Empty, null) as Node;
Interop.NodeBlockExporter.AddNodeType(instance);
}
_initialized = true;
}
}
}