public ToolBoxItemFunctionModel( MethodInfo mi, AttributeTuple <DesignElementAttribute, Type> data, DesignerResource resource) : base(data, resource) { this.MethodInfo = mi; }
public ToolBoxItemFunctionModel( MethodInfo mi, AttributeTuple <DesignElementAttribute, Type> data, DesignerResource resource) : base(data, resource) { this.MethodInfo = mi; this.IsSupportJS = mi.HasAttribute <JSCodeMapAttribute>(); }
// 일반 레이아웃 및 컴포넌트 public ToolBoxItemModel(AttributeTuple <DesignElementAttribute, Type> data, DesignerResource resource) { this.Metadata = data; this.Resource = resource; this.ToolTip = this.Resource.ToolTip; this.Category = Metadata.Attribute.Category; string displayName = Metadata.Attribute.DisplayName; // Default Display Name if (string.IsNullOrEmpty(displayName)) { displayName = Metadata.Element.GetType().Name; } this.Title = displayName; }
private void InitializeLayouts() { // ToolBox foreach (var element in DesignerManager.GetElementTypes() .OrderBy(data => data.Attribute.Category) .OrderBy(data => data.Element.CanCastingTo <PComponent>() ? 1 : 0)) { if (!element.Attribute.Visible) { continue; } var resource = ResourceManager.GetDesignerResource(element.Element); toolBox.AddItem( new ToolBoxItemView( new ToolBoxItemModel(element, resource))); } foreach (var function in SDKManager.GetFunctions()) { var resource = new DesignerResource() { Content = new Image() { Source = ResourceManager.GetImageSource("Icons/IconFunction.png") } }; toolBox.AddItem( new ToolBoxItemView( new ToolBoxItemFunctionModel( function.Element, new AttributeTuple <Core.DesignElementAttribute, Type>(function.Attribute, typeof(PFunction)), resource))); } }