Ejemplo n.º 1
0
        private void btnAddFIS_Click(System.Object sender, System.EventArgs e)
        {
            OpenFileDialog frm = new OpenFileDialog();

            frm.Title  = "Select a FIS File";
            frm.Filter = "GCD FIS Files (*.fis) | *.fis";

            if (ProjectManager.FISLibrary.FISItems.Count > 0)
            {
                FileInfo fisFile = ProjectManager.FISLibrary.FISItems.Last().FilePath;
                if (fisFile.Directory.Exists)
                {
                    frm.InitialDirectory = fisFile.DirectoryName;
                }
            }

            if (frm.ShowDialog() == DialogResult.OK)
            {
                frmFISProperties frmFIS = new frmFISProperties(frm.FileName);
                if (frmFIS.ShowDialog() == DialogResult.OK)
                {
                    ProjectManager.FISLibrary.FISItems.ResetBindings();
                    foreach (DataGridViewRow dgvr in grdFIS.Rows)
                    {
                        if (((FISLibraryItem)dgvr.DataBoundItem == frmFIS.FISLibraryItem))
                        {
                            dgvr.Selected = true;
                            grdFIS.FirstDisplayedScrollingRowIndex = dgvr.Index;
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void btnEditFIS_Click(System.Object sender, System.EventArgs e)
        {
            FISLibraryItem   item = (FISLibraryItem)grdFIS.SelectedRows[0].DataBoundItem;
            frmFISProperties frm  = new frmFISProperties(item);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                ProjectManager.FISLibrary.FISItems.ResetBindings();
            }
        }