From 762127a4aa1ee393f19e08018830bc8ba023c050 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Sun, 9 Jan 2022 10:37:25 +0300 Subject: Refactoring --- src/Forms/SettingsForm.Designer.cs | 46 -------------- src/Forms/SettingsForm.cs | 21 ------- src/Forms/SettingsForm.resx | 120 ------------------------------------- 3 files changed, 187 deletions(-) delete mode 100644 src/Forms/SettingsForm.Designer.cs delete mode 100644 src/Forms/SettingsForm.cs delete mode 100644 src/Forms/SettingsForm.resx (limited to 'src/Forms') diff --git a/src/Forms/SettingsForm.Designer.cs b/src/Forms/SettingsForm.Designer.cs deleted file mode 100644 index 669406e..0000000 --- a/src/Forms/SettingsForm.Designer.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace RehauSku.Forms -{ - partial class SettingsForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // SettingsForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Name = "SettingsForm"; - this.Text = "SettingsForm"; - this.ResumeLayout(false); - - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Forms/SettingsForm.cs b/src/Forms/SettingsForm.cs deleted file mode 100644 index 4dffadb..0000000 --- a/src/Forms/SettingsForm.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace RehauSku.Forms -{ - public partial class SettingsForm : Form - { - public SettingsForm() - { - InitializeComponent(); - } - - } -} diff --git a/src/Forms/SettingsForm.resx b/src/Forms/SettingsForm.resx deleted file mode 100644 index 1af7de1..0000000 --- a/src/Forms/SettingsForm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file -- cgit v1.2.3 From 846547d6d905e0dbee73cd9c62760ea43bb88134 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Sun, 9 Jan 2022 15:47:54 +0300 Subject: Add SaveAs Dialog after export --- src/Forms/Dialog.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/Forms') diff --git a/src/Forms/Dialog.cs b/src/Forms/Dialog.cs index 170cc81..cc1c29a 100644 --- a/src/Forms/Dialog.cs +++ b/src/Forms/Dialog.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using Microsoft.Office.Interop.Excel; +using System.Collections.Generic; using System.Windows.Forms; namespace RehauSku.Forms @@ -42,5 +43,20 @@ namespace RehauSku.Forms return fileNames.ToArray(); } + + public static void SaveWorkbookAs() + { + Workbook wb = AddIn.Excel.ActiveWorkbook; + string currentFilename = wb.FullName; + string fileFilter = "Файлы Excel (*.xls;*.xlsx;*.xlsm),*.xls;*.xlsx;*.xlsm"; + + object fileName = AddIn.Excel.GetSaveAsFilename(currentFilename, fileFilter); + + if (fileName.GetType() == typeof(string)) + wb.SaveAs(fileName); + + else + wb.Close(false); + } } } -- cgit v1.2.3