コード例 #1
0
        private void ActionOpenFromFile()
        {
            OpenFileDialog openDialog = new OpenFileDialog();
            openDialog.FileName = "Worksheet1";
            openDialog.DefaultExt = ".xlsx";
            openDialog.Filter = "Office Open XML|*.xlsx|Excel 2007/2010|*.xlsx";
            openDialog.Multiselect = false;
            openDialog.Title = "Metro Tables - Open document...";

            Nullable<bool> result = openDialog.ShowDialog();

            if (result.HasValue && result.Value == true) {
                if (openDialog.CheckFileExists) {
                    try {
                        tablesControl = new TablesControl(openDialog.FileName);
                        ActivateTopControl(tablesControl);
                    }
                    catch (Exception ex) {
                        MessageBox.Show("Document can't be opened!", "Metro Tables", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
                else {
                    MessageBox.Show("Selected file doesn't exist!", "Metro Tables", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
コード例 #2
0
        private void Load()
        {
            tablesControl = new TablesControl();
            topControl.Content = tablesControl;

            GenerateSparkles();
        }
コード例 #3
0
        private void ActionNewEmptyWorksheet()
        {
            tablesControl = new TablesControl();

            ActivateTopControl(tablesControl);
        }