public static ClassCanvasItem CreateItemFromType(IClass ct) { if (ct == null) { return(null); } ClassCanvasItem item = null; if (ct.ClassType == ClassType.Interface) { item = new InterfaceCanvasItem(ct); } else if (ct.ClassType == ClassType.Enum) { item = new EnumCanvasItem(ct); } else if (ct.ClassType == ClassType.Struct) { item = new StructCanvasItem(ct); } else if (ct.ClassType == ClassType.Delegate) { item = new DelegateCanvasItem(ct); } else { item = new ClassCanvasItem(ct); } item.Initialize(); return(item); }
public static ClassCanvasItem CreateItemFromType (IClass ct) { if (ct == null) return null; ClassCanvasItem item = null; if (ct.ClassType == ClassType.Interface) item = new InterfaceCanvasItem(ct); else if (ct.ClassType == ClassType.Enum) item = new EnumCanvasItem(ct); else if (ct.ClassType == ClassType.Struct) item = new StructCanvasItem(ct); else if (ct.ClassType == ClassType.Delegate) item = new DelegateCanvasItem(ct); else item = new ClassCanvasItem(ct); item.Initialize(); return item; }