aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/IML/Node.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-11-22 17:49:16 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-11-22 17:49:16 +0100
commitf416267010e2d44badae89ceb76df3b27dd69a67 (patch)
tree59fd7e8e44af4a6674bbbe50ebaedefbf089992a /src/IML/Node.cs
parentf7512fd4b75d815f4b78fcc844523d2bfc5f2bd1 (diff)
debug
Diffstat (limited to 'src/IML/Node.cs')
-rw-r--r--src/IML/Node.cs39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/IML/Node.cs b/src/IML/Node.cs
index a503a3bb..14cffdb2 100644
--- a/src/IML/Node.cs
+++ b/src/IML/Node.cs
@@ -28,7 +28,7 @@ namespace Crow.IML
/// <summary>
/// IML Node are the elements of the interface XML,
/// </summary>
- public class Node
+ public struct Node
{
public Type CrowType;
/// <summary>
@@ -59,43 +59,6 @@ namespace Crow.IML
public bool HasTemplate {
get { return typeof (TemplatedControl).IsAssignableFrom (CrowType);}
}
- public MethodInfo AddMethod {
- get {
- if (typeof (Group).IsAssignableFrom (CrowType))
- return CompilerServices.miAddChild;
- if (typeof (Container).IsAssignableFrom (CrowType))
- return CompilerServices.miSetChild;
- if (typeof (TemplatedContainer).IsAssignableFrom (CrowType))
- return Index < 0 ? CompilerServices.miLoadTmp : CompilerServices.miSetContent;
- if (typeof (TemplatedGroup).IsAssignableFrom (CrowType))
- return Index < 0 ? CompilerServices.miLoadTmp : CompilerServices.miAddItem;
- if (typeof (TemplatedControl).IsAssignableFrom (CrowType))
- return CompilerServices.miLoadTmp;
- return null;
- }
- }
- public void EmitGetInstance (ILGenerator il){
- if (typeof (Group).IsAssignableFrom (CrowType)) {
- il.Emit (OpCodes.Ldfld, typeof(Group).GetField ("children", BindingFlags.Instance | BindingFlags.NonPublic));
- il.Emit(OpCodes.Ldc_I4, Index);
- il.Emit (OpCodes.Callvirt, typeof(List<GraphicObject>).GetMethod("get_Item", new Type[] { typeof(Int32) }));
- return;
- }
- if (typeof(Container).IsAssignableFrom (CrowType) || Index < 0) {
- il.Emit (OpCodes.Ldfld, typeof(PrivateContainer).GetField ("child", BindingFlags.Instance | BindingFlags.NonPublic));
- return;
- }
- if (typeof(TemplatedContainer).IsAssignableFrom (CrowType)) {
- il.Emit (OpCodes.Callvirt, typeof(TemplatedContainer).GetProperty ("Content").GetGetMethod ());
- return;
- }
- if (typeof(TemplatedGroup).IsAssignableFrom (CrowType)) {
- il.Emit (OpCodes.Callvirt, typeof(TemplatedGroup).GetProperty ("Items").GetGetMethod ());
- il.Emit(OpCodes.Ldc_I4, Index);
- il.Emit (OpCodes.Callvirt, typeof(List<GraphicObject>).GetMethod("get_Item", new Type[] { typeof(Int32) }));
- return;
- }
- }
public static implicit operator string (Node sn)
{