コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (MainToolbar != null)
            {
                MainToolbar.Dispose();
                MainToolbar = null;
            }

            if (PagePopUpButton != null)
            {
                PagePopUpButton.Dispose();
                PagePopUpButton = null;
            }

            if (RefreshButton != null)
            {
                RefreshButton.Dispose();
                RefreshButton = null;
            }

            if (Spinner != null)
            {
                Spinner.Dispose();
                Spinner = null;
            }

            if (TitleTextField != null)
            {
                TitleTextField.Dispose();
                TitleTextField = null;
            }
        }
コード例 #2
0
 public void UpdatePagesPopupButton()
 {
     PagePopUpButton.AddItem("Page 1");
     PagePopUpButton.Activated += delegate {
         Console.WriteLine(PagePopUpButton.SelectedItem.Title);
     };
 }
コード例 #3
0
        void UpdatePagesPopupButton()
        {
            foreach (FigmaCanvas canvas in fileProvider.Nodes.OfType <FigmaCanvas>())
            {
                PagePopUpButton.AddItem(canvas.name);
            }

            if (Page_ID != null)
            {
                PagePopUpButton.SelectItem(Page_ID);
            }
        }
コード例 #4
0
        public void UpdatePagesPopupButton(FigmaDocument document, int pageIndex)
        {
            PagePopUpButton.RemoveAllItems();

            foreach (var item in document.children.ToArray())
            {
                PagePopUpButton.AddItem(item.name);

                PagePopUpButton.Activated += delegate {
                    PageChanged?.Invoke(this, (int)PagePopUpButton.IndexOfSelectedItem);
                };
            }

            if (pageIndex + 1 > document.children.Length)
            {
                PagePopUpButton.SelectItem(0);
            }
            else
            {
                PagePopUpButton.SelectItem(pageIndex);
            }
        }