Exemplo n.º 1
0
        private void tcLists_SelectedIndexChanged(object sender, EventArgs e)
        {
            TabPage tab = ((TabControl)sender).SelectedTab;

            if (tab.Equals(tabEdit))
            {
                if (boxSelected > 0)
                {
                    state = State.Editing;
                }
            }
            else if (tab.Equals(tabLands))
            {
                state = State.Idle;
                LandSelected();
            }
            else if (tab.Equals(tabRegions))
            {
                state = State.Idle;
                RegionSelected();
            }
            else if (tab.Equals(tabHavens))
            {
                state = State.Idle;
                HavenSelected();
            }
            else
            {
                state = State.Idle;
            }
        }
Exemplo n.º 2
0
        private void ReflashSelectedTabPage(TabPage currentTabPage)
        {
            int    channelNum = 0;
            string errMsg;

            this.Lable_Message.Text = "";
            if (currentTabPage.Equals(this.tabPage_Power))
            {
                //do nothing;
            }
            else if (currentTabPage.Equals(this.tabPage_Password))
            {
                //do nothing;
            }
            else
            {
                if (currentTabPage.Equals(this.tabPage_Hostlist))
                {
                    channelNum = (int)this.comboBox_HostChannel.SelectedItem;
                }
                else if (currentTabPage.Equals(this.tabPage_Serial))
                {
                    channelNum = (int)this.comboBox_SerialChannel.SelectedItem;
                }
                else if (currentTabPage.Equals(this.tabPage_Connection))
                {
                    channelNum = (int)this.comboBox_ConnChannel.SelectedItem;
                }

                DevControl.tagErrorCode eCode = this.AutoProperty.GetParameter(currentTabPage, channelNum);
                errMsg = ErrorHandling.HandleDeviceError(eCode, this.CurrentDevice);
                this.Lable_Message.Text = errMsg;
                //    System.Windows.Forms.MessageBox.Show(errMsg);
            }
        }
Exemplo n.º 3
0
 void SheetSelection_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && SourceTab != null)
     {
         SuspendLayout();
         TabPage currTabPage = GetTabPageFromXY(e.X, e.Y);
         if (currTabPage != null && !currTabPage.Equals(SourceTab))
         {
             SourceTab.SuspendLayout();
             if (SheetSelection.TabPages.IndexOf(currTabPage) < SheetSelection.TabPages.IndexOf(SourceTab))
             {
                 SheetSelection.TabPages.Remove(SourceTab);
                 SheetSelection.TabPages.Insert(SheetSelection.TabPages.IndexOf(currTabPage), SourceTab);
                 SheetSelection.SelectedTab = SourceTab;
             }
             else if (SheetSelection.TabPages.IndexOf(currTabPage) > SheetSelection.TabPages.IndexOf(SourceTab))
             {
                 SheetSelection.TabPages.Remove(SourceTab);
                 SheetSelection.TabPages.Insert(SheetSelection.TabPages.IndexOf(currTabPage) + 1, SourceTab);
                 SheetSelection.SelectedTab = SourceTab;
             }
             SourceTab.ResumeLayout();
         }
     }
     ResumeLayout();
     SourceTab = null;
     Cursor    = Cursors.Default;
 }
Exemplo n.º 4
0
        private void Tab_ViewersMouseClick(object sender, MouseEventArgs e)
        {
            switch (e.Button)
            {
            case MouseButtons.Left:

                if (Tab_Viewers.SelectedTab.Equals(Tab_NewViewer))
                {
                    NewViewerPage(-1, "", null);
                }

                break;

            case MouseButtons.Right:

                ContextTabPage = GetTabPageAtPosition(e.Location);

                if (!(ContextTabPage == null))
                {
                    if (!(ContextTabPage.Equals(Tab_NewViewer)))
                    {
                        Context_TabViewers.Show(e.Location);
                    }
                    else
                    {
                        ContextTabPage = null;
                    }
                }

                break;
            }
        }
Exemplo n.º 5
0
 private void setSubsolTabData(TabPage page, File file)
 {
     if (file != null)
     {
         if (page.Equals(historyPage))
         {
             (new GetHistoryTask(file)).execute();
             historyPage.Show();
         }
         else
         {
             commentLabel.Text = file.lastComment;
         }
     }
 }
        /// <summary>
        /// 通过标签名称获取当前标签的索引
        /// </summary>
        /// <param name="tab"></param>
        /// <param name="pageName"></param>
        /// <returns></returns>
        public static int GetTabIndex(TabControl tab, TabPage page)
        {
            int index = -1;

            for (int i = 0, len = tab.TabCount; i < len; i++)
            {
                TabPage pp = tab.TabPages[i];
                if (pp.Equals(page))
                {
                    index = i;
                    break;
                }
            }
            return(index);
        }
Exemplo n.º 7
0
        private void SaveCodeFile(RichTextBox rxtTab, TabPage currentTab)
        {
            var serverCodePath = GenerateCodeFolderServer;
            var clientCodePath = GenerateCodeFolderClient;

            string fullFileName = null;

            if (currentTab.Equals(tPageUIView))
            {
                fullFileName = string.Format(@"{0}\{1}\{2}{3}", clientCodePath, "ConfigFile", txtEntityName.Text, ".xml");
            }
            else if (currentTab.Equals(tPageServerEntity))
            {
                fullFileName = string.Format(@"{0}\{1}\{2}{3}", serverCodePath, "Model", txtEntityName.Text, "Info.cs");
            }
            else if (currentTab.Equals(tPageServerSql))
            {
                fullFileName = string.Format(@"{0}\{1}\{2}{3}", serverCodePath, "ConfigFile", txtEntityName.Text, ".xml");
            }
            else if (currentTab.Equals(tPageServerRule))
            {
                fullFileName = string.Format(@"{0}\{1}{2}", serverCodePath, txtEntityName.Text, ".cs");
            }
            else if (currentTab.Equals(tPageServerInterface))
            {
                fullFileName = string.Format(@"{0}\{1}\I{2}{3}", serverCodePath, "IFace", txtEntityName.Text, ".cs");
            }
            else if (currentTab.Equals(tPageEditForm))
            {
                fullFileName = string.Format(@"{0}\FrmEdit{1}{2}", clientCodePath, txtEntityName.Text, ".cs");
            }
            else if (currentTab.Equals(tPageUIRule))
            {
                fullFileName = string.Format(@"{0}\{1}\{2}{3}", clientCodePath, "UIRule", txtEntityName.Text, ".cs");
            }
            else
            {
                fullFileName = null;
                return;
            }
            if (!string.IsNullOrWhiteSpace(fullFileName))
            {
                if (!Directory.Exists(Path.GetDirectoryName(fullFileName)))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(fullFileName));
                }
                File.WriteAllText(fullFileName, rxtTab.Text, Encoding.UTF8);
            }
        }
Exemplo n.º 8
0
        private void DrawTab(PaintEventArgs e)
        {
            #region 背景描画

            e.Graphics.FillRectangle(new SolidBrush(backColor), this.ClientRectangle);
            if (TabPages.Count < 1)
            {
                return;
            }

            #endregion

            if (SelectedIndex >= 0)
            {
                #region ページ枠描画

                TabPage   tp = TabPages[SelectedIndex];
                Rectangle tr = new Rectangle();
                switch (this.Alignment)
                {
                case TabAlignment.Top:
                    tr = new Rectangle(tp.Bounds.X - 4, tp.Bounds.Y - 3, tp.Bounds.Width + 6, tp.Bounds.Height + 6);
                    break;

                case TabAlignment.Bottom:
                    tr = new Rectangle(tp.Bounds.X - 4, tp.Bounds.Y - 4, tp.Bounds.Width + 6, tp.Bounds.Height + 6);
                    break;

                case TabAlignment.Left:
                    tr = new Rectangle(tp.Bounds.X - 3, tp.Bounds.Y - 4, tp.Bounds.Width + 6, tp.Bounds.Height + 7);
                    break;

                case TabAlignment.Right:
                    tr = new Rectangle(tp.Bounds.X - 4, tp.Bounds.Y - 4, tp.Bounds.Width + 6, tp.Bounds.Height + 7);
                    break;
                }
                if (Appearance == TabAppearance.Normal)
                {
                    switch (this.Alignment)
                    {
                    case TabAlignment.Top:
                        tr.Width  += 3;
                        tr.Height += 1;
                        break;

                    case TabAlignment.Bottom:
                        tr.Width  += 3;
                        tr.Height += 2;
                        break;

                    case TabAlignment.Left:
                        tr.Width  += 2;
                        tr.Height += 1;
                        break;

                    case TabAlignment.Right:
                        tr.Width  += 3;
                        tr.Height += 1;
                        break;
                    }
                    TabRenderer.DrawTabPage(e.Graphics, tr);
                }
                else
                {
                    e.Graphics.FillRectangle(new SolidBrush(tp.BackColor), tr);
                    e.Graphics.DrawRectangle(new Pen(SystemColors.ControlDark), tr);
                }

                #endregion

                #region タブ描画

                System.Windows.Forms.VisualStyles.TabItemState    tstat;
                System.Windows.Forms.VisualStyles.PushButtonState bstat;
                for (int ii = 0; ii <= TabPages.Count; ii++)
                {
                    if (ii != SelectedIndex)
                    {
                        int i = ii;
                        if (ii == TabPages.Count)
                        {
                            i = SelectedIndex;
                        }

                        tp = TabPages[i];
                        tr = GetTabRect(i);

                        #region タブ表示状態を決定

                        if (!Enabled)
                        {
                            tstat = System.Windows.Forms.VisualStyles.TabItemState.Disabled;
                            bstat = System.Windows.Forms.VisualStyles.PushButtonState.Disabled;
                        }
                        else if (SelectedIndex == i)
                        {
                            tstat = System.Windows.Forms.VisualStyles.TabItemState.Selected;
                            bstat = System.Windows.Forms.VisualStyles.PushButtonState.Pressed;
                        }
                        else
                        {
                            tstat = System.Windows.Forms.VisualStyles.TabItemState.Normal;
                            bstat = System.Windows.Forms.VisualStyles.PushButtonState.Normal;
                        }

                        #endregion

                        #region タブの調整

                        switch (this.Alignment)
                        {
                        case TabAlignment.Top:
                            tr.Y      -= 2;
                            tr.Height += 1;
                            if (Appearance == TabAppearance.Normal)
                            {
                                if (SelectedIndex == i)
                                {
                                    tr.X      -= 2;
                                    tr.Width  += 4;
                                    tr.Height += 1;
                                }
                                else
                                {
                                    tr.Y      += 2;
                                    tr.Height -= 2;
                                }
                            }
                            break;

                        case TabAlignment.Bottom:
                            tr.Y      += 1;
                            tr.Height += 1;
                            if (Appearance == TabAppearance.Normal)
                            {
                                if (SelectedIndex == i)
                                {
                                    tr.X      -= 2;
                                    tr.Width  += 4;
                                    tr.Y      -= 1;
                                    tr.Height += 1;
                                }
                                else
                                {
                                    tr.Height -= 2;
                                }
                            }
                            break;

                        case TabAlignment.Left:
                            tr.X     -= 2;
                            tr.Width += 1;
                            if (Appearance == TabAppearance.Normal)
                            {
                                if (SelectedIndex == i)
                                {
                                    tr.Width  += 1;
                                    tr.Y      -= 2;
                                    tr.Height += 4;
                                }
                                else
                                {
                                    tr.X     += 2;
                                    tr.Width -= 2;
                                }
                            }
                            break;

                        case TabAlignment.Right:
                            tr.X     += 1;
                            tr.Width += 1;
                            if (Appearance == TabAppearance.Normal)
                            {
                                if (SelectedIndex == i)
                                {
                                    tr.X      -= 1;
                                    tr.Width  += 1;
                                    tr.Y      -= 2;
                                    tr.Height += 4;
                                }
                                else
                                {
                                    tr.Width -= 2;
                                }
                            }
                            break;
                        }

                        #endregion

                        #region タブの生成と描画

                        StringFormat sf = new StringFormat();
                        sf.Alignment     = StringAlignment.Center;
                        sf.LineAlignment = StringAlignment.Center;

                        #region ビットマップ生成

                        Size ims;
                        if (Alignment == TabAlignment.Left || Alignment == TabAlignment.Right)
                        {
                            ims = new Size(tr.Height, tr.Width);
                        }
                        else
                        {
                            ims = tr.Size;
                        }
                        String tabText = tp.Text;
                        if (Alignment == TabAlignment.Bottom)
                        {
                            tabText = "";
                        }
                        Bitmap bmp = new Bitmap(ims.Width, ims.Height);

                        #endregion

                        #region ビットマップ描画

                        Graphics g  = Graphics.FromImage(bmp);
                        Brush    tb = (Brush)SystemBrushes.ControlText.Clone();
                        switch (Appearance)
                        {
                        case TabAppearance.Normal:
                            TabRenderer.DrawTabItem(g, new Rectangle(0, 0, bmp.Width, bmp.Height + 1), tabText, tp.Font, this.Focused && tp.Equals(SelectedTab), tstat);
                            break;

                        case TabAppearance.Buttons:
                            ButtonRenderer.DrawButton(g, new Rectangle(0, 0, bmp.Width, bmp.Height), tabText, tp.Font, this.Focused && tp.Equals(SelectedTab), bstat);
                            break;

                        case TabAppearance.FlatButtons:
                            Brush fb, bb;
                            Pen   bp;
                            if (SelectedIndex == i)
                            {
                                fb = new SolidBrush(PushOnForeColor);
                                bb = new SolidBrush(PushOnBackColor);
                                bp = new Pen(PushOnBorderColor);
                            }
                            else
                            {
                                fb = new SolidBrush(PushOffForeColor);
                                bb = new SolidBrush(PushOffBackColor);
                                bp = new Pen(PushOffBorderColor);
                            }
                            g.FillRectangle(bb, new Rectangle(2, 2, bmp.Width - 4, bmp.Height - 4));
                            g.DrawRectangle(bp, new Rectangle(1, 1, bmp.Width - 3, bmp.Height - 3));
                            if (this.Focused && tp.Equals(SelectedTab))
                            {
                                Pen focusPen = new Pen(Color.DarkGoldenrod);
                                focusPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                                g.DrawRectangle(new Pen(Color.Black), new Rectangle(3, 3, bmp.Width - 7, bmp.Height - 7));
                                g.DrawRectangle(focusPen, new Rectangle(3, 3, bmp.Width - 7, bmp.Height - 7));
                            }
                            tb.Dispose();
                            tb = (Brush)fb.Clone();
                            g.DrawString(tabText, tp.Font, tb, new Rectangle(0, 0, bmp.Width, bmp.Height), sf);
                            fb.Dispose();
                            bb.Dispose();
                            break;
                        }
                        g.Dispose();

                        #endregion

                        #region ビットマップの回転

                        switch (this.Alignment)
                        {
                        case TabAlignment.Bottom:
                            bmp.RotateFlip(RotateFlipType.Rotate180FlipNone);
                            g = Graphics.FromImage(bmp);
                            g.DrawString(tp.Text, tp.Font, tb, new RectangleF(0, 0, bmp.Width, bmp.Height), sf);
                            g.Dispose();
                            break;

                        case TabAlignment.Left:
                            bmp.RotateFlip(RotateFlipType.Rotate270FlipNone);
                            break;

                        case TabAlignment.Right:
                            bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
                            break;
                        }
                        e.Graphics.DrawImage(bmp, tr);
                        bmp.Dispose();
                        tb.Dispose();
                        sf.Dispose();

                        #endregion

                        #endregion
                    }
                }

                #endregion
            }
        }
Exemplo n.º 9
0
        private void SubmitSelectedTabPage(TabPage currentTabPage)
        {
            string errMsg;

            DevControl.tagErrorCode eCode;

            if (currentTabPage.Equals(this.tabPage_Power))
            {
                RebootType rebootType;

                if (radioButton_Default.Checked)
                {
                    rebootType = RebootType.DefaultWithoutReboot;
                }
                else if (radioButton_DefaultReboot.Checked)
                {
                    rebootType = RebootType.DefaultAndReboot;
                }
                else if (radioButton_Reboot.Checked)
                {
                    rebootType = RebootType.RebootWithoutSave;
                }
                else
                {
                    rebootType = RebootType.SaveAndReboot;
                }

                eCode = this.CurrentDevice.RebootManage(rebootType);
                //返回值处理
                errMsg = ErrorHandling.HandleDeviceError(eCode, this.CurrentDevice);
                this.Lable_Message.Text = errMsg;
                System.Windows.Forms.MessageBox.Show(errMsg);
            }
            else if (currentTabPage.Equals(this.tabPage_Password))
            {
                string password, newPassword;

                password    = this.oldPwdTB.Text.Trim();
                newPassword = this.newPwdTB.Text.Trim();

                if ((password == "") || (newPassword == ""))
                {
                    System.Windows.Forms.MessageBox.Show("Password required!");
                    return;
                }

                if (newPassword != this.retypePwdTB.Text.Trim())
                {
                    System.Windows.Forms.MessageBox.Show("Password are not same!");
                    return;
                }
                //
                eCode = this.CurrentDevice.ModifyPassword(password, newPassword);
                //返回值处理
                errMsg = ErrorHandling.HandleDeviceError(eCode, this.CurrentDevice);
                this.Lable_Message.Text = errMsg;
                System.Windows.Forms.MessageBox.Show(errMsg);
            }
            else
            {
                int channelNum = 0;

                if (currentTabPage.Equals(this.tabPage_Hostlist))
                {
                    channelNum = (int)this.comboBox_HostChannel.SelectedItem;
                }
                else if (currentTabPage.Equals(this.tabPage_Serial))
                {
                    channelNum = (int)this.comboBox_SerialChannel.SelectedItem;
                }
                else if (currentTabPage.Equals(this.tabPage_Connection))
                {
                    channelNum = (int)this.comboBox_ConnChannel.SelectedItem;
                }

                eCode = this.AutoProperty.SetParameter(currentTabPage, channelNum);
                //返回值处理
                errMsg = ErrorHandling.HandleDeviceError(eCode, this.CurrentDevice);
                this.Lable_Message.Text = errMsg;
                System.Windows.Forms.MessageBox.Show(errMsg);
            }
        }
Exemplo n.º 10
0
        public bool RemoveSpecifiedTab(string tabName, bool confirm)
        {
            int idx;

            for (idx = 0; idx < ListTab.TabPages.Count; idx++)
            {
                if (ListTab.TabPages[idx].Text == tabName)
                {
                    break;
                }
            }

            if (_statuses.IsDefaultTab(tabName))
            {
                return(false);
            }

            if (confirm)
            {
                string tmp    = string.Format(R.RemoveSpecifiedTabText1, Environment.NewLine);
                var    result = MessageBox.Show(tmp, string.Format("{0} {1}", tabName, R.RemoveSpecifiedTabText2), MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Cancel)
                {
                    return(false);
                }
            }

            SetListProperty(); // 他のタブに列幅等を反映

            TabUsageType tabType = _statuses.Tabs[tabName].TabType;

            // オブジェクトインスタンスの削除
            SplitContainer1.Panel1.SuspendLayout();
            SplitContainer1.Panel2.SuspendLayout();
            SplitContainer1.SuspendLayout();
            ListTab.SuspendLayout();
            SuspendLayout();

            TabPage tabPage    = ListTab.TabPages[idx];
            var     listCustom = (DetailsListView)tabPage.Tag;

            tabPage.Tag = null;
            tabPage.SuspendLayout();

            if (ReferenceEquals(ListTab.SelectedTab, ListTab.TabPages[idx]))
            {
                ListTab.SelectTab(_prevSelectedTab != null && ListTab.TabPages.Contains(_prevSelectedTab) ? _prevSelectedTab : ListTab.TabPages[0]);
            }

            ListTab.Controls.Remove(tabPage);

            if (tabType == TabUsageType.PublicSearch)
            {
                Control pnl = tabPage.Controls["panelSearch"];
                foreach (Control ctrl in pnl.Controls)
                {
                    if (ctrl.Name == "buttonSearch")
                    {
                        ctrl.Click -= SearchButton_Click;
                    }

                    ctrl.Enter -= SearchControls_Enter;
                    ctrl.Leave -= SearchControls_Leave;
                    pnl.Controls.Remove(ctrl);
                    ctrl.Dispose();
                }

                tabPage.Controls.Remove(pnl);
            }

            tabPage.Controls.Remove(listCustom);
            listCustom.Columns.Clear();
            listCustom.ContextMenuStrip = null;

            listCustom.SelectedIndexChanged -= MyList_SelectedIndexChanged;
            listCustom.MouseDoubleClick     -= MyList_MouseDoubleClick;
            listCustom.ColumnClick          -= MyList_ColumnClick;
            listCustom.DrawColumnHeader     -= MyList_DrawColumnHeader;
            listCustom.DragDrop             -= TweenMain_DragDrop;
            listCustom.DragOver             -= TweenMain_DragOver;
            listCustom.DrawItem             -= MyList_DrawItem;
            listCustom.MouseClick           -= MyList_MouseClick;
            listCustom.ColumnReordered      -= MyList_ColumnReordered;
            listCustom.ColumnWidthChanged   -= MyList_ColumnWidthChanged;
            listCustom.CacheVirtualItems    -= MyList_CacheVirtualItems;
            listCustom.RetrieveVirtualItem  -= MyList_RetrieveVirtualItem;
            listCustom.DrawSubItem          -= MyList_DrawSubItem;
            listCustom.HScrolled            -= MyList_HScrolled;

            _tabDialog.RemoveTab(tabName);

            listCustom.SmallImageList     = null;
            listCustom.ListViewItemSorter = null;

            // キャッシュのクリア
            if (_curTab.Equals(tabPage))
            {
                _curTab       = null;
                _curItemIndex = -1;
                _curList      = null;
                _curPost      = null;
            }

            _itemCache      = null;
            _itemCacheIndex = -1;
            _postCache      = null;

            tabPage.ResumeLayout(false);

            SplitContainer1.Panel1.ResumeLayout(false);
            SplitContainer1.Panel2.ResumeLayout(false);
            SplitContainer1.ResumeLayout(false);
            ListTab.ResumeLayout(false);
            ResumeLayout(false);
            PerformLayout();

            tabPage.Dispose();
            listCustom.Dispose();
            _statuses.RemoveTab(tabName);

            foreach (TabPage tp in ListTab.TabPages)
            {
                var lst = (DetailsListView)tp.Tag;
                lst.VirtualListSize = _statuses.Tabs[tp.Text].AllCount;
            }

            return(true);
        }
Exemplo n.º 11
0
 private void SelectedTabGenerateCode(TabPage currentTab)
 {
     try
     {
         setRemark();
         if (_DataSet == null || _HasLoadPage.Contains(currentTab))
         {
             return;
         }
         RichTextBox currentRichTextBox = null;
         if (currentTab.Equals(tPageUIView))
         {
             rxtUIXmlView.Clear();
             LocalLanguageObject language = new LocalLanguageObject(rxtLanguage);
             UIXmlGenerateHelper uiXml    = new UIXmlGenerateHelper(_DataSet.Tables[0].Columns, language);
             uiXml.GenerateToRichTextBox(rxtUIXmlView);
             currentRichTextBox = rxtUIXmlView;
         }
         else if (currentTab.Equals(tPageServerEntity))
         {
             rxtServerEntity.Clear();
             GenerateEntityModelHelper code = new GenerateEntityModelHelper(cobTableName.Text, txtEntityName.Text, "ID", _DataSet.Tables[0].Columns);
             code.GenerateToRichTextBox(rxtServerEntity);
             currentRichTextBox = rxtServerEntity;
         }
         else if (currentTab.Equals(tPageServerSql))
         {
             rxtServerSqlXml.Clear();
             ServerXmlSqlGenerate serverSql = new ServerXmlSqlGenerate(cobTableName.Text, _DataSet.Tables[0].Columns);
             serverSql.GenerateToRichTextBox(rxtServerSqlXml);
             currentRichTextBox = rxtServerSqlXml;
         }
         else if (currentTab.Equals(tPageServerRule))
         {
             rxtServerRule.Clear();
             ServerRuleGenerate serverRule = new ServerRuleGenerate(cobTableName.Text, txtEntityName.Text, "ID");
             serverRule.GenerateToRichTextBox(rxtServerRule, false);
             currentRichTextBox = rxtServerRule;
         }
         else if (currentTab.Equals(tPageServerInterface))
         {
             rxtServerInterface.Clear();
             ServerRuleGenerate serverRule = new ServerRuleGenerate(cobTableName.Text, txtEntityName.Text, "ID");
             serverRule.GenerateToRichTextBox(rxtServerInterface, true);
             currentRichTextBox = rxtServerInterface;
         }
         else if (currentTab.Equals(tPageEditForm))
         {
             rxtUIEditForm.Clear();
             UIEditFormGenerateHelper editForm = new UIEditFormGenerateHelper(cobTableName.Text, txtEntityName.Text);
             editForm.GenerateToRichTextBox(rxtUIEditForm, false);
             currentRichTextBox = rxtUIEditForm;
         }
         else if (currentTab.Equals(tPageUIRule))
         {
             rxtUIRule.Clear();
             UIEditFormGenerateHelper editForm = new UIEditFormGenerateHelper(cobTableName.Text, txtEntityName.Text);
             editForm.GenerateToRichTextBox(rxtUIRule, true);
             currentRichTextBox = rxtUIRule;
         }
         else
         {
             return;
         }
         _HasLoadPage.Add(currentTab);
         SaveCodeFile(currentRichTextBox, currentTab);
     }
     catch (Exception ex)
     {
         MessageBox.Show("tabControl1_SelectedIndexChanged:" + ex.Message);
     }
 }