public override Type GetControlType()

in FigmaSharp/FigmaSharp.Cocoa/Converters/Layers/RectangleVectorConverter.cs [41:81]


        public override Type GetControlType(FigmaNode currentNode)
            => typeof(NSView);

        public override IView ConvertToView (FigmaNode currentNode, ViewNode parent, ViewRenderService rendererService)
        {
            var vectorEntity = (RectangleVector)currentNode;
            IView view;
            if (rendererService.NodeProvider.RendersAsImage (currentNode))
                view = new ImageView();
            else
                view = new View();

            var currengroupView = (NSView) view.NativeObject;
            currengroupView.Configure (currentNode);

            if (vectorEntity.HasFills) {
                foreach (var fill in vectorEntity.fills) {
                    if (fill.type == "IMAGE") {
                        //we need to add this to our service
                    } else if (fill.type == "SOLID") {
                        if (fill.visible && fill.color != null) {
                            currengroupView.Layer.BackgroundColor = fill.color.ToCGColor (fill.opacity);
                        }
                    } else {
                        LoggingService.LogWarning ($"NOT IMPLEMENTED FILL : {fill.type}");
                    }
                }
            }

            currengroupView.Layer.CornerRadius = vectorEntity.cornerRadius;
          
            var stroke = vectorEntity.strokes?.FirstOrDefault ();
            if (stroke != null) {
                currengroupView.Layer.BorderWidth = vectorEntity.strokeWeight;
                if (stroke.visible && stroke.color != null) {
                    currengroupView.Layer.BorderColor = stroke.color.ToCGColor (stroke.opacity);
                }
            }
            //view.layer.borderColor = UIColor (red: 1, green: 1, blue: 1, alpha: 1).cgColor
            return view;
        }