예제 #1
0
        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);
        }
예제 #2
0
		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;
		}