public static ICanvasDrawableObject CanvasFromDrawableObject(IBlackboardObject srcInstance) { TypeAndAssembly ta = CanvasFromDrawableObjectMap [srcInstance.GetType().ToString()]; ObjectHandle handle = null; handle = Activator.CreateInstance(ta.AssemblyName, ta.Type.ToString()); return((ICanvasDrawableObject)handle.Unwrap()); }
public static ICanvasSelectableObject CanvasFromDrawableObject(IBlackboardObject drawable) { string objecttype = String.Format ("LongoMatch.Drawing.CanvasObjects.Blackboard.{0}Object", drawable.GetType ().ToString ().Split ('.').Last ()); ObjectHandle handle = Activator.CreateInstance (null, objecttype); ICanvasDrawableObject d = (ICanvasDrawableObject)handle.Unwrap (); d.IDrawableObject = drawable; return d; }
public static ICanvasSelectableObject CanvasFromDrawableObject(IBlackboardObject drawable) { string objecttype = String.Format("LongoMatch.Drawing.CanvasObjects.Blackboard.{0}Object", drawable.GetType().ToString().Split('.').Last()); ObjectHandle handle = Activator.CreateInstance(null, objecttype); ICanvasDrawableObject d = (ICanvasDrawableObject)handle.Unwrap(); d.IDrawableObject = drawable; return(d); }