Beispiel #1
0
        public Form1()
        {
            InitializeComponent();

            //Initiate worker
            worker = new BackgroundWorker();

            //Worker Event Handlers
            worker.DoWork             += new DoWorkEventHandler(worker_DoWork);
            worker.ProgressChanged    += new ProgressChangedEventHandler(worker_ProgressChanged);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);

            //Enable Progress Reorting
            worker.WorkerReportsProgress = true;

            //Create tab metadata for Welcome page
            TabExtraInfo welcomePage = new TabExtraInfo(0, "N/A");

            tabMetadataList.Insert(0, welcomePage);
        }
Beispiel #2
0
        private void PromptUnsavedChangesCloseTab(TabExtraInfo tabInfo)
        {
            UnsavedChangesSingleFile unsavedChangesBox = new UnsavedChangesSingleFile();

            unsavedChangesBox.ShowDialog();

            switch (unsavedChangesBox.GetUserAnswer())
            {
            case UnsavedChangesSingleFile.saveAndClose:
                Save(tabInfo.GetAssocaitedFileName(), tabControl1.SelectedIndex);
                DeleteTab();
                break;

            case UnsavedChangesSingleFile.closeWithoutSaving:
                DeleteTab();
                break;

            case UnsavedChangesSingleFile.Cancel:
                break;
            }
        }
Beispiel #3
0
        private bool PromptUnsavedChangesOpenTab(TabExtraInfo tabInfo)
        {
            UnsavedChangesSingleFile unsavedChangesBox = new UnsavedChangesSingleFile();

            unsavedChangesBox.ShowDialog();

            switch (unsavedChangesBox.GetUserAnswer())
            {
            case UnsavedChangesSingleFile.saveAndClose:
                Save(tabInfo.GetAssocaitedFileName(), tabControl1.SelectedIndex);
                return(true);

            case UnsavedChangesSingleFile.closeWithoutSaving:
                return(true);

            case UnsavedChangesSingleFile.Cancel:
                return(false);

            default:
                return(false);    // Should be unreachable
            }
        }
Beispiel #4
0
        private void NewWindow()
        {
            TabPage           tb  = new TabPage();
            GridDataBoundGrid dbg = new GridDataBoundGrid();

            InitGrid(dbg);
            loader.GetPluginByTargetFramework("GridDataBoundGrid", dbg);

            //GridCardView card = new GridCardView();
            //card.CaptionField = "ProductName";
            //card.WireGrid(dbg);
            DataTable dt = new DataTable();

            tb.Text = "New";

            tb.Controls.Add(dbg);
            tabControl1.TabPages.Add(tb);
            tabControl1.SelectedTab = tb;

            TabExtraInfo newTab = new TabExtraInfo(tabControl1.TabCount - 1, "N/A");

            tabMetadataList.Insert(tabControl1.TabCount - 1, newTab);
        }