Example #1
0
 private void OnCurrentTabChanged(object sender, EventArgs e)
 {
     _previousTab?.UnsubscribeWeak(OnCurrentTabPropertyChanged);
     _previousTab = Browser.CurrentTab;
     _previousTab?.SubscribeWeak(OnCurrentTabPropertyChanged);
     OnAddressChanged();
 }
Example #2
0
 public Stored(string id, IEnumerable <WebTab> tabs, WebTab selected, bool alwaysKeepAlive)
 {
     Id              = id;
     Tabs            = tabs.ToArray();
     Selected        = selected;
     AlwaysKeepAlive = alwaysKeepAlive;
 }
        public MainForm()
        {
            InitializeComponent();
            Cef.Initialize(new CefSettings()); //required for cefsharp to work, only needs to be called once

            //Add web tabs
            WebTab Chat = new WebTab("https://discord.gg/zUqJTYP")
            {
                Text = "Chat"
            };
            WebTab News = new WebTab("https://ygodevpro.com/forum/index.php/Board/14-Announcements/")
            {
                Text = "News"
            };
            WebTab BugTracker = new WebTab("https://ygodevpro.com/forum/bugs/")
            {
                Text = "BugTracker"
            };
            IntPtr h = MainTabControl.Handle; //required for insert to work

            MainTabControl.TabPages.Insert(0, Chat);
            MainTabControl.TabPages.Insert(1, News);
            MainTabControl.TabPages.Insert(2, BugTracker);
            MainTabControl.SelectedIndex = 0;

            //Server Select
            ServerSelect.Items.Add("LocalHost");
            ServerSelect.SelectedIndex = 0;

            //options
            AddOptions();
            YGOProOptionsControl.ItemCheck += UpdateOptions;
        }
        private void AddMainMenuTab(string id, string text, IconInfo icon)
        {
            WebTab tab = new WebTab();

            tab.Text   = text;
            tab.ItemID = id;
            tab.Icon   = icon;
            NavigationTabs.Tabs.Add(tab);
        }
        private void AddTab(string id, string text, IconInfo icon)
        {
            WebTab tab = new WebTab();

            tab.Text   = text;
            tab.ItemID = id;
            tab.Icon   = icon;
            PagesTabStrip.Tabs.Add(tab);
        }
Example #6
0
 protected override void SetUpPage()
 {
     base.SetUpPage();
     _tabStrip = new WebTabStrip();
     _tab0     = new WebTab("Tab0", "Tab 0");
     _tab1     = new WebTab("Tab1", "Tab 1");
     _tab2     = new WebTab("Tab2", "Tab 2");
     _tab3     = new WebTab("Tab3", "Tab 3");
     _tabNew   = new WebTab("Tab5", "Tab 5");
 }
Example #7
0
        private void ShowDataDic(DBSource dBSource, string dbname, string tbname, string html)
        {
            var tit = $"数据字典-[{dbname}].[{tbname}]";

            foreach (TabPage tab in this.TabControl.TabPages)
            {
                if (tab.Text.Equals(tit))
                {
                    (tab as UC.WebTab).SetHtml(html);
                    TabControl.SelectedTab = tab;
                    return;
                }
            }
            UC.WebTab panel = new WebTab();
            panel.SetHtml(html);
            panel.Text = tit;
            this.TabControl.TabPages.Add(panel);
            this.TabControl.SelectedTab = panel;
        }
Example #8
0
        private void ShowTables(string dbname, string html)
        {
            var tit = $"查看{dbname}的库表";

            foreach (TabPage tab in this.TabControl.TabPages)
            {
                if (tab.Text.Equals(tit))
                {
                    (tab as UC.WebTab).SetHtml(html);
                    TabControl.SelectedTab = tab;
                    return;
                }
            }
            UC.WebTab panel = new WebTab();
            panel.SetHtml(html);
            panel.Text      = tit;
            panel.OnSearch += (w) =>
            {
            };
            this.TabControl.TabPages.Add(panel);
            this.TabControl.SelectedTab = panel;
        }
Example #9
0
        public MainForm()
        {
            Cef.EnableHighDPISupport();
            Cef.Initialize(new CefSettings()); //required for cefsharp to work, only needs to be called once
            InitializeComponent();

            //Add web tabs
            WebTab Chat = new WebTab("https://discord.gg/C4P3cp6")
            {
                Text = "Chat"
            };
            WebTab News = new WebTab("http://www.ygodevpro.com/category/blog/")
            {
                Text = "News"
            };
            WebTab BugTracker = new WebTab("https://ygodevpro.com/forum/forumdisplay.php?fid=16")
            {
                Text = "BugTracker"
            };
            IntPtr h = MainTabControl.Handle; //required for insert to work

            MainTabControl.TabPages.Insert(0, Chat);
            MainTabControl.TabPages.Insert(1, News);
            MainTabControl.TabPages.Insert(2, BugTracker);
            MainTabControl.SelectedIndex = 0;

            //Server Select
            Config.AddServer("Butty's Test Server", "81.98.22.127", 8911);
            Config.AddServer("LocalHost", "127.0.0.1", 8911);
            ServerSelect.Items.AddRange(Config.GetServerList());
            ServerSelect.SelectedIndexChanged += UpdateSelectedServer;
            ServerSelect.SelectedIndex         = 0;

            //options
            AddOptions();
            YGOProOptionsControl.ItemCheck += UpdateOptions;
        }