Пример #1
0
        public FormImageFile(FormMaster master, TabPageCustom tabPage, string fileName)
        {
            InitializeComponent();

            this.tabPage = tabPage;
            this.master  = master;
            LoadForm(fileName);

            this.btnOpen.Text  = Resource.btnOpenExplorer;
            this.btnClose.Text = Resource.btnCloseTab;
        }
Пример #2
0
        public FormTextFile(FormMaster master, TabPageCustom tabPage, string fileName)
        {
            InitializeComponent();

            this.TabStop = false;

            this.tabPage = tabPage;
            this.master  = master;
            LoadForm(fileName);

            this.btnOpen.Text  = Resource.btnOpenExplorer;
            this.btnClose.Text = Resource.btnCloseTab;
            this.btnSave.Text  = Resource.btnSaveFile;

            this.originalText = this.btnSave.Text;
        }
Пример #3
0
        public TabPageCustom AddTab(Form form, object tag, string text)
        {
            var textSuffix = (text == null ? "" : ": " + text);

            if (form is FormWebRequest)
            {
                text = "WebRequest" + textSuffix;
            }
            else if (form is FormCompare)
            {
                text = "Compare" + textSuffix;
            }
            else if (form is FormTextView)
            {
                text = "Editor" + textSuffix;
            }
            else if (form is FormJsonViewer)
            {
                text = "JSON" + textSuffix;
            }

            var tabpage = new TabPageCustom {
                Text = text
            };

            tabpage.Tag = new Tag {
                Form = form, InternalTag = tag
            };

            tabpage.BorderStyle = BorderStyle.Fixed3D;
            tabControl.TabPages.Add(tabpage);
            form.TopLevel = false;
            form.Parent   = tabpage;
            form.Show();
            form.Dock = DockStyle.Fill;
            tabControl.SelectedTab = tabpage;
            if (form is IFormFileUpdate formFile)
            {
                tabpage.CanClose = formFile.CanClose;
            }
            return(tabpage);
        }
Пример #4
0
 public void CloseTab(TabPageCustom tab)
 {
     tabControl.TabPages.Remove(tab);
     tabControl.SelectLastTab();
 }
Пример #5
0
 internal void SelectTab(TabPageCustom tab)
 {
     this.tabControl.SelectedTab = tab;
 }
Пример #6
0
 public Form GetForm(TabPageCustom tab)
 {
     return(((TabMaster.Tag)tab.Tag).Form);
 }
Пример #7
0
 public Tag GetTag(TabPageCustom tab)
 {
     return((Tag)tab.Tag);
 }