コード例 #1
0
ファイル: MDIProject.cs プロジェクト: xetra11/cardmaker
        private void addReferenceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var sFile = FormUtils.FileOpenHandler("CSV files (*.csv)|*.csv|All files (*.*)|*.*", null, true);

            if (null != sFile)
            {
                tryToAddReferenceNode(sFile);
            }
        }
コード例 #2
0
        private void addReferenceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var sFile = FormUtils.FileOpenHandler("CSV files (*.csv)|*.csv|All files (*.*)|*.*", null, true);

            if (null != sFile)
            {
                var zLayout     = (ProjectLayout)treeView.SelectedNode.Tag;
                var bNewDefault = 0 == treeView.SelectedNode.Nodes.Count;
                var tnReference = AddReferenceNode(treeView.SelectedNode, sFile, bNewDefault, zLayout);
                if (null == tnReference)
                {
                    MessageBox.Show(this, "The specified reference is already associated with this layout.", "Reference Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (bNewDefault)
                {
                    tnReference.Parent.Expand();
                    LayoutManager.Instance.FireLayoutUpdatedEvent(true);
                }
                ProjectManager.Instance.FireProjectUpdated(true);
            }
        }
コード例 #3
0
ファイル: MDIProject.cs プロジェクト: xetra11/cardmaker
        private void addExcelReferenceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var sFile = FormUtils.FileOpenHandler("Excel files (*.xlsx)|*.xlsx|All files (*.*)|*.*", null, true);

            if (null != sFile)
            {
                // Open File
                var workbook = new XLWorkbook(sFile);

                // Grab all the sheet names
                List <string> sheets = new List <string>();
                foreach (IXLWorksheet sheet in workbook.Worksheets)
                {
                    sheets.Add(sheet.Name);
                }

                // Let the user select a sheet from the spreadsheet they selected
                ExcelSheetSelectionDialog dialog = new ExcelSheetSelectionDialog(sheets);
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    tryToAddReferenceNode(ExcelSpreadsheetReference.generateFullReference(sFile, dialog.GetSelectedSheet()));
                }
            }
        }
コード例 #4
0
 private void btnElementBrowseImage_Click(object sender, EventArgs e)
 {
     FormUtils.FileOpenHandler("All files (*.*)|*.*", txtElementVariable, true);
 }