Exemple #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            copyCSButton.Activated         += CopyCSButton_Activated;
            copyDesignerCSButton.Activated += CopyDesignerCSButton_Activated;
            openUrlButton.Activated        += OpenUrlButton_Activated;

            // Do any additional setup after loading the view.
            outlinePanel = new OutlinePanel();

            var scrollView = outlinePanel.EnclosingScrollView;

            outlinePanel.RaiseFirstResponder += OutlinePanel_RaiseFirstResponder;

            urlTextField.Activated += UrlTextField_Activated;

            treeHierarchyContainer.AddSubview(scrollView);

            treeHierarchyContainer.TranslatesAutoresizingMaskIntoConstraints = false;
            scrollView.TranslatesAutoresizingMaskIntoConstraints             = false;

            scrollView.TopAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.TopAnchor).Active       = true;
            scrollView.BottomAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.BottomAnchor).Active = true;
            scrollView.LeftAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.LeftAnchor).Active     = true;
            scrollView.RightAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.RightAnchor).Active   = true;

            figmaDelegate = new FigmaDesignerDelegate();

            urlTextField.StringValue = fileIds;

            RefreshTree(fileIds);
        }
Exemple #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Do any additional setup after loading the view.
            outlinePanel = new OutlinePanel();

            var scrollView = outlinePanel.EnclosingScrollView;

            outlinePanel.RaiseFirstResponder += OutlinePanel_RaiseFirstResponder;

            treeHierarchyContainer.AddSubview(scrollView);

            treeHierarchyContainer.TranslatesAutoresizingMaskIntoConstraints = false;
            scrollView.TranslatesAutoresizingMaskIntoConstraints             = false;

            scrollView.TopAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.TopAnchor).Active       = true;
            scrollView.BottomAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.BottomAnchor).Active = true;
            scrollView.LeftAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.LeftAnchor).Active     = true;
            scrollView.RightAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.RightAnchor).Active   = true;

            figmaDelegate = new FigmaDesignerDelegate();

            var converters = FigmaSharp.AppContext.Current.GetFigmaConverters()
                             .Union(Resources.GetConverters())
                             .ToArray();

            fileProvider = new FigmaRemoteFileProvider();
            fileProvider.Load("CobaSo7LmEYsuGZB0ED0ewSs");

            var addChildConverter = new FigmaCodeAddChildConverter();
            var positionConverter = new FigmaCodePositionConverter();

            codeRenderer = new FigmaCodeRendererService(fileProvider, converters, positionConverter, addChildConverter);

            data = new FigmaNodeView(fileProvider.Response.document);
            figmaDelegate.ConvertToNodes(fileProvider.Response.document, data);
            outlinePanel.GenerateTree(data);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            copyCSButton.Activated         += CopyCSButton_Activated;
            copyDesignerCSButton.Activated += CopyDesignerCSButton_Activated;
            openUrlButton.Activated        += OpenUrlButton_Activated;

            // Do any additional setup after loading the view.
            outlinePanel = new OutlinePanel();

            var scrollView = outlinePanel.EnclosingScrollView;

            outlinePanel.RaiseFirstResponder += OutlinePanel_RaiseFirstResponder;

            urlTextField.Activated += UrlTextField_Activated;

            treeHierarchyContainer.AddSubview(scrollView);

            treeHierarchyContainer.TranslatesAutoresizingMaskIntoConstraints = false;
            scrollView.TranslatesAutoresizingMaskIntoConstraints             = false;

            scrollView.TopAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.TopAnchor).Active           = true;
            scrollView.BottomAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.BottomAnchor).Active     = true;
            scrollView.LeadingAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.LeadingAnchor).Active   = true;
            scrollView.TrailingAnchor.ConstraintEqualToAnchor(treeHierarchyContainer.TrailingAnchor).Active = true;

            translateButton.State = NSCellStateValue.Off;

            figmaDelegate = new FigmaDesignerDelegate();

            if (File.Exists(FilePath))
            {
                urlTextField.StringValue = File.ReadAllText(FilePath) ?? string.Empty;
                RefreshTree(urlTextField.StringValue);
            }
        }