diff options
-rw-r--r-- | RehauSku.Assist.csproj | 8 | ||||
-rw-r--r-- | Source/Assistant/HttpClientUtil.cs | 2 | ||||
-rw-r--r-- | Source/Ribbon/RibbonController.cs | 17 | ||||
-rw-r--r-- | Source/Settings/SettingsForm.Designer.cs | 46 | ||||
-rw-r--r-- | Source/Settings/SettingsForm.cs | 32 | ||||
-rw-r--r-- | Source/Settings/SettingsForm.resx | 120 |
6 files changed, 218 insertions, 7 deletions
diff --git a/RehauSku.Assist.csproj b/RehauSku.Assist.csproj index 6f12a34..1497201 100644 --- a/RehauSku.Assist.csproj +++ b/RehauSku.Assist.csproj @@ -71,6 +71,7 @@ <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> <Reference Include="System.Data.OracleClient" /> + <Reference Include="System.Drawing" /> <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath> </Reference> @@ -99,6 +100,7 @@ <Reference Include="WindowsBase" /> </ItemGroup> <ItemGroup> + <Compile Include="Source\AddIn\RegistryUtil.cs" /> <Compile Include="Source\Assistant\MemoryCacheExtensions.cs" /> <Compile Include="Source\Assistant\ParseUtil.cs" /> <Compile Include="Source\Assistant\RequestModifier.cs" /> @@ -112,6 +114,12 @@ <Compile Include="Source\AddIn\Functions.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Source\Assistant\SkuAssist.cs" /> + <Compile Include="Source\Settings\SettingsForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Source\Settings\SettingsForm.Designer.cs"> + <DependentUpon>SettingsForm.cs</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <None Include="app.config" /> diff --git a/Source/Assistant/HttpClientUtil.cs b/Source/Assistant/HttpClientUtil.cs index 16e4287..63be4a8 100644 --- a/Source/Assistant/HttpClientUtil.cs +++ b/Source/Assistant/HttpClientUtil.cs @@ -28,7 +28,7 @@ namespace RehauSku.Assistant baseUri.Path = "/catalogsearch/result/index/"; string cleanedRequest = request.CleanRequest(); - switch (AddIn.StoreResponse) + switch (AddIn.StoreResponseOrder) { case ResponseOrder.Relevance: baseUri.Query = "dir=asc&order=relevance&q=" + cleanedRequest; diff --git a/Source/Ribbon/RibbonController.cs b/Source/Ribbon/RibbonController.cs index 39cf71a..7e15d09 100644 --- a/Source/Ribbon/RibbonController.cs +++ b/Source/Ribbon/RibbonController.cs @@ -10,17 +10,16 @@ namespace RehauSku.Ribbon { public override string GetCustomUI(string RibbonID) { - return @" <customUI xmlns='http://schemas.microsoft.com/office/2006/01/customui'> <ribbon> <tabs> <tab id='rau' label='REHAU'> <group id='priceList' label='Прайс-лист'> - <button id='exportToPrice' label='Экспорт' size='large' imageMso='PivotExportToExcel' onAction='OnButtonPressed'/> + <button id='exportToPrice' label='Экспорт' size='large' imageMso='PivotExportToExcel' onAction='OnExportPressed'/> </group> <group id='rausettings' label='Настройки'> - <button id='set' label='Настройки' size='large' imageMso='CurrentViewSettings' onAction='OnButtonPressed'/> + <button id='set' label='Настройки' size='large' imageMso='CurrentViewSettings' onAction='OnSettingsPressed'/> </group> </tab> </tabs> @@ -28,14 +27,14 @@ namespace RehauSku.Ribbon </customUI>"; } - public void OnButtonPressed(IRibbonControl control) + public void OnExportPressed(IRibbonControl control) { using (Exporter dw = new Exporter()) { if (!dw.IsRangeValid()) { - MessageBox.Show("Выделен неверный диапазон!", - "Неверный диапазон", + MessageBox.Show("Выделен неверный диапазон!", + "Неверный диапазон", MessageBoxButtons.OK, MessageBoxIcon.Information); return; @@ -48,5 +47,11 @@ namespace RehauSku.Ribbon } } } + + + public void OnSettingsPressed(IRibbonControl control) + { + Application.Run(new Settings.SettingsForm()); + } } } diff --git a/Source/Settings/SettingsForm.Designer.cs b/Source/Settings/SettingsForm.Designer.cs new file mode 100644 index 0000000..ea14638 --- /dev/null +++ b/Source/Settings/SettingsForm.Designer.cs @@ -0,0 +1,46 @@ +namespace RehauSku.Settings +{ + partial class SettingsForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + 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/Source/Settings/SettingsForm.cs b/Source/Settings/SettingsForm.cs new file mode 100644 index 0000000..b87ac5c --- /dev/null +++ b/Source/Settings/SettingsForm.cs @@ -0,0 +1,32 @@ +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.Settings +{ + public partial class SettingsForm : Form + { + public SettingsForm() + { + InitializeComponent(); + + FormClosing += (sender, eventArgs) => + { + MessageBox.Show("ok"); + }; + + + } + + private void button1_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/Source/Settings/SettingsForm.resx b/Source/Settings/SettingsForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Source/Settings/SettingsForm.resx @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file |