コード例 #1
0
        public void DblClickExplorer(TreeListNode focusedNode)
        {
            var nodeContent = (FileSystemItem)focusedNode.Content;

            if (nodeContent.FullName.IndexOf(".xls", 0, StringComparison.InvariantCultureIgnoreCase) < 0 &&
                nodeContent.FullName.IndexOf(".xlsx", 0, StringComparison.InvariantCultureIgnoreCase) < 0)
            {
                return;
            }
            WorkSheetsInBook.Clear();
            SourceFilePath = nodeContent.FullName;
        }
コード例 #2
0
        public void DocumentLoaded(object spreadSheet)
        {
            if (!(spreadSheet is SpreadsheetControl))
            {
                return;
            }
            var workBook = ((SpreadsheetControl)spreadSheet).Document;

            foreach (var itemWorkSheet in workBook.Worksheets)
            {
                var sheetInfo = new SheetInfo {
                    WorkSheet = itemWorkSheet, GoodColumns = GoodColumns
                };

                sheetInfo.ParseWorkSheet();

                var columnHeaders = new List <string>();

                sheetInfo.ColumnHeaderList.ForEach(ch => columnHeaders.Add(ch.Caption));

                WorkSheetsInBook.Add(sheetInfo);
                ImportService.AddColumnHeadersAsync(columnHeaders.ToArray(), sheetInfo);
            }
        }