Browse Source

RoundEx and CeilingEx

wook 4 years ago
parent
commit
4ee77a2954

+ 6
- 0
MathEx.sln View File

@@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.26403.7
5 5
 MinimumVisualStudioVersion = 10.0.40219.1
6 6
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MathEx", "MathEx\MathEx.csproj", "{FE22BB43-5C91-451E-8E5C-08D02AA4B080}"
7 7
 EndProject
8
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MathExExample", "MathExExample\MathExExample.csproj", "{14B091F4-F22E-43EE-B6AE-1453DB9AE246}"
9
+EndProject
8 10
 Global
9 11
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 12
 		Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
15 17
 		{FE22BB43-5C91-451E-8E5C-08D02AA4B080}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 18
 		{FE22BB43-5C91-451E-8E5C-08D02AA4B080}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 19
 		{FE22BB43-5C91-451E-8E5C-08D02AA4B080}.Release|Any CPU.Build.0 = Release|Any CPU
20
+		{14B091F4-F22E-43EE-B6AE-1453DB9AE246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21
+		{14B091F4-F22E-43EE-B6AE-1453DB9AE246}.Debug|Any CPU.Build.0 = Debug|Any CPU
22
+		{14B091F4-F22E-43EE-B6AE-1453DB9AE246}.Release|Any CPU.ActiveCfg = Release|Any CPU
23
+		{14B091F4-F22E-43EE-B6AE-1453DB9AE246}.Release|Any CPU.Build.0 = Release|Any CPU
18 24
 	EndGlobalSection
19 25
 	GlobalSection(SolutionProperties) = preSolution
20 26
 		HideSolutionNode = FALSE

+ 0
- 12
MathEx/Class1.cs View File

@@ -1,12 +0,0 @@
1
-using System;
2
-using System.Collections.Generic;
3
-using System.Linq;
4
-using System.Text;
5
-using System.Threading.Tasks;
6
-
7
-namespace MathEx
8
-{
9
-    public class Class1
10
-    {
11
-    }
12
-}

+ 55
- 0
MathEx/MathEx.cs View File

@@ -0,0 +1,55 @@
1
+using System;
2
+
3
+namespace MathExtention
4
+{
5
+    public static class MathEx
6
+    {
7
+		/// <summary>
8
+		/// Round Number by Custom Interval
9
+		/// </summary>
10
+		/// <param name="d0">Primitive</param>
11
+		/// <param name="di">Interval</param>
12
+		/// <returns></returns>
13
+		public static double RoundEx(double d0, double di)
14
+		{
15
+			di = 1 / di;
16
+			return Math.Round(d0 * di) / di;
17
+		}
18
+
19
+		/// <summary>
20
+		/// Round Number by Custom Interval
21
+		/// </summary>
22
+		/// <param name="d0">Primitive</param>
23
+		/// <param name="di">Interval</param>
24
+		/// <returns></returns>
25
+		public static decimal RoundEx(decimal d0, decimal di)
26
+		{
27
+			di = 1 / di;
28
+			return Math.Round(d0 * di) / di;
29
+		}
30
+
31
+		/// <summary>
32
+		/// Ceiling Number by Custom Interval
33
+		/// </summary>
34
+		/// <param name="d0">Primitive</param>
35
+		/// <param name="di">Interval</param>
36
+		/// <returns></returns>
37
+		public static double CeilingEx(double d0, double di)
38
+		{
39
+			di = 1 / di;
40
+			return (d0 > 0 ? Math.Ceiling(d0 * di) : Math.Floor(d0 * di)) / di;
41
+		}
42
+
43
+		/// <summary>
44
+		/// Ceiling Number by Custom Interval
45
+		/// </summary>
46
+		/// <param name="d0">Primitive</param>
47
+		/// <param name="di">Interval</param>
48
+		/// <returns></returns>
49
+		public static decimal CeilingEx(decimal d0, decimal di)
50
+		{
51
+			di = 1 / di;
52
+			return (d0 > 0 ? Math.Ceiling(d0 * di) : Math.Floor(d0 * di)) / di;
53
+		}
54
+	}
55
+}

+ 9
- 18
MathEx/MathEx.csproj View File

@@ -1,10 +1,10 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
+<?xml version="1.0" encoding="utf-8"?>
2 2
 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 3
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4 4
   <PropertyGroup>
5 5
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 6
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
-    <ProjectGuid>fe22bb43-5c91-451e-8e5c-08d02aa4b080</ProjectGuid>
7
+    <ProjectGuid>{FE22BB43-5C91-451E-8E5C-08D02AA4B080}</ProjectGuid>
8 8
     <OutputType>Library</OutputType>
9 9
     <AppDesignerFolder>Properties</AppDesignerFolder>
10 10
     <RootNamespace>MathEx</RootNamespace>
@@ -30,24 +30,15 @@
30 30
     <WarningLevel>4</WarningLevel>
31 31
   </PropertyGroup>
32 32
   <ItemGroup>
33
-    <Reference Include="System"/>
34
-    
35
-    <Reference Include="System.Core"/>
36
-    <Reference Include="System.Xml.Linq"/>
37
-    <Reference Include="System.Data.DataSetExtensions"/>
38
-    
39
-    
40
-    <Reference Include="Microsoft.CSharp"/>
41
-    
42
-    <Reference Include="System.Data"/>
43
-    
44
-    <Reference Include="System.Net.Http"/>
45
-    
46
-    <Reference Include="System.Xml"/>
33
+    <Reference Include="System" />
34
+    <Reference Include="System.Core" />
35
+    <Reference Include="System.Data.DataSetExtensions" />
36
+    <Reference Include="Microsoft.CSharp" />
37
+    <Reference Include="System.Data" />
47 38
   </ItemGroup>
48 39
   <ItemGroup>
49
-    <Compile Include="Class1.cs" />
40
+    <Compile Include="MathEx.cs" />
50 41
     <Compile Include="Properties\AssemblyInfo.cs" />
51 42
   </ItemGroup>
52 43
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53
- </Project>
44
+</Project>

+ 6
- 0
MathExExample/App.config View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+    <startup> 
4
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5
+    </startup>
6
+</configuration>

+ 153
- 0
MathExExample/Form1.Designer.cs View File

@@ -0,0 +1,153 @@
1
+namespace MathExExample
2
+{
3
+	partial class Form1
4
+	{
5
+		/// <summary>
6
+		/// Required designer variable.
7
+		/// </summary>
8
+		private System.ComponentModel.IContainer components = null;
9
+
10
+		/// <summary>
11
+		/// Clean up any resources being used.
12
+		/// </summary>
13
+		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+		protected override void Dispose(bool disposing)
15
+		{
16
+			if (disposing && (components != null))
17
+			{
18
+				components.Dispose();
19
+			}
20
+			base.Dispose(disposing);
21
+		}
22
+
23
+		#region Windows Form Designer generated code
24
+
25
+		/// <summary>
26
+		/// Required method for Designer support - do not modify
27
+		/// the contents of this method with the code editor.
28
+		/// </summary>
29
+		private void InitializeComponent()
30
+		{
31
+			this.numPrimitive = new System.Windows.Forms.NumericUpDown();
32
+			this.numInterval = new System.Windows.Forms.NumericUpDown();
33
+			this.lblInterval = new System.Windows.Forms.Label();
34
+			this.lblResult = new System.Windows.Forms.Label();
35
+			this.numResult = new System.Windows.Forms.NumericUpDown();
36
+			((System.ComponentModel.ISupportInitialize)(this.numPrimitive)).BeginInit();
37
+			((System.ComponentModel.ISupportInitialize)(this.numInterval)).BeginInit();
38
+			((System.ComponentModel.ISupportInitialize)(this.numResult)).BeginInit();
39
+			this.SuspendLayout();
40
+			// 
41
+			// numPrimitive
42
+			// 
43
+			this.numPrimitive.DecimalPlaces = 2;
44
+			this.numPrimitive.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
45
+			this.numPrimitive.Increment = new decimal(new int[] {
46
+            5,
47
+            0,
48
+            0,
49
+            131072});
50
+			this.numPrimitive.Location = new System.Drawing.Point(91, 13);
51
+			this.numPrimitive.Maximum = new decimal(new int[] {
52
+            1000,
53
+            0,
54
+            0,
55
+            0});
56
+			this.numPrimitive.Name = "numPrimitive";
57
+			this.numPrimitive.Size = new System.Drawing.Size(90, 29);
58
+			this.numPrimitive.TabIndex = 1;
59
+			this.numPrimitive.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
60
+			this.numPrimitive.ValueChanged += new System.EventHandler(this.num_ValueChanged);
61
+			// 
62
+			// numInterval
63
+			// 
64
+			this.numInterval.DecimalPlaces = 2;
65
+			this.numInterval.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
66
+			this.numInterval.Increment = new decimal(new int[] {
67
+            5,
68
+            0,
69
+            0,
70
+            131072});
71
+			this.numInterval.Location = new System.Drawing.Point(90, 48);
72
+			this.numInterval.Maximum = new decimal(new int[] {
73
+            1000,
74
+            0,
75
+            0,
76
+            0});
77
+			this.numInterval.Name = "numInterval";
78
+			this.numInterval.Size = new System.Drawing.Size(90, 29);
79
+			this.numInterval.TabIndex = 2;
80
+			this.numInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
81
+			this.numInterval.ValueChanged += new System.EventHandler(this.num_ValueChanged);
82
+			// 
83
+			// lblInterval
84
+			// 
85
+			this.lblInterval.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
86
+			this.lblInterval.Location = new System.Drawing.Point(12, 48);
87
+			this.lblInterval.Name = "lblInterval";
88
+			this.lblInterval.Size = new System.Drawing.Size(72, 29);
89
+			this.lblInterval.TabIndex = 1;
90
+			this.lblInterval.Text = "Interval";
91
+			this.lblInterval.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
92
+			// 
93
+			// lblResult
94
+			// 
95
+			this.lblResult.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
96
+			this.lblResult.Location = new System.Drawing.Point(12, 80);
97
+			this.lblResult.Name = "lblResult";
98
+			this.lblResult.Size = new System.Drawing.Size(72, 29);
99
+			this.lblResult.TabIndex = 1;
100
+			this.lblResult.Text = "Result";
101
+			this.lblResult.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
102
+			// 
103
+			// numResult
104
+			// 
105
+			this.numResult.DecimalPlaces = 2;
106
+			this.numResult.Enabled = false;
107
+			this.numResult.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
108
+			this.numResult.Increment = new decimal(new int[] {
109
+            5,
110
+            0,
111
+            0,
112
+            131072});
113
+			this.numResult.Location = new System.Drawing.Point(90, 83);
114
+			this.numResult.Maximum = new decimal(new int[] {
115
+            1000,
116
+            0,
117
+            0,
118
+            0});
119
+			this.numResult.Name = "numResult";
120
+			this.numResult.ReadOnly = true;
121
+			this.numResult.Size = new System.Drawing.Size(90, 29);
122
+			this.numResult.TabIndex = 0;
123
+			this.numResult.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
124
+			// 
125
+			// Form1
126
+			// 
127
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
128
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
129
+			this.ClientSize = new System.Drawing.Size(194, 128);
130
+			this.Controls.Add(this.lblResult);
131
+			this.Controls.Add(this.lblInterval);
132
+			this.Controls.Add(this.numResult);
133
+			this.Controls.Add(this.numInterval);
134
+			this.Controls.Add(this.numPrimitive);
135
+			this.Name = "Form1";
136
+			this.Text = "MathEx";
137
+			((System.ComponentModel.ISupportInitialize)(this.numPrimitive)).EndInit();
138
+			((System.ComponentModel.ISupportInitialize)(this.numInterval)).EndInit();
139
+			((System.ComponentModel.ISupportInitialize)(this.numResult)).EndInit();
140
+			this.ResumeLayout(false);
141
+
142
+		}
143
+
144
+		#endregion
145
+
146
+		private System.Windows.Forms.NumericUpDown numPrimitive;
147
+		private System.Windows.Forms.NumericUpDown numInterval;
148
+		private System.Windows.Forms.Label lblInterval;
149
+		private System.Windows.Forms.Label lblResult;
150
+		private System.Windows.Forms.NumericUpDown numResult;
151
+	}
152
+}
153
+

+ 32
- 0
MathExExample/Form1.cs View File

@@ -0,0 +1,32 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.ComponentModel;
4
+using System.Data;
5
+using System.Drawing;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+using System.Windows.Forms;
10
+using MathExtention;
11
+
12
+namespace MathExExample
13
+{
14
+	public partial class Form1 : Form
15
+	{
16
+		public Form1()
17
+		{
18
+			InitializeComponent();
19
+			this.numPrimitive.Value = 285.30m;
20
+			this.numInterval.Value = 2.5m;
21
+		}
22
+
23
+		private void num_ValueChanged(object sender, EventArgs e)
24
+		{
25
+			if (this.numInterval.Value != 0)
26
+			{
27
+				this.numResult.Value = MathEx.RoundEx(this.numPrimitive.Value, this.numInterval.Value);
28
+				this.numPrimitive.Focus();
29
+			}
30
+		}
31
+	}
32
+}

+ 120
- 0
MathExExample/Form1.resx View File

@@ -0,0 +1,120 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+</root>

+ 88
- 0
MathExExample/MathExExample.csproj View File

@@ -0,0 +1,88 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4
+  <PropertyGroup>
5
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
+    <ProjectGuid>{14B091F4-F22E-43EE-B6AE-1453DB9AE246}</ProjectGuid>
8
+    <OutputType>WinExe</OutputType>
9
+    <RootNamespace>MathExExample</RootNamespace>
10
+    <AssemblyName>MathExExample</AssemblyName>
11
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12
+    <FileAlignment>512</FileAlignment>
13
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14
+  </PropertyGroup>
15
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16
+    <PlatformTarget>AnyCPU</PlatformTarget>
17
+    <DebugSymbols>true</DebugSymbols>
18
+    <DebugType>full</DebugType>
19
+    <Optimize>false</Optimize>
20
+    <OutputPath>bin\Debug\</OutputPath>
21
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
+    <ErrorReport>prompt</ErrorReport>
23
+    <WarningLevel>4</WarningLevel>
24
+  </PropertyGroup>
25
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
+    <PlatformTarget>AnyCPU</PlatformTarget>
27
+    <DebugType>pdbonly</DebugType>
28
+    <Optimize>true</Optimize>
29
+    <OutputPath>bin\Release\</OutputPath>
30
+    <DefineConstants>TRACE</DefineConstants>
31
+    <ErrorReport>prompt</ErrorReport>
32
+    <WarningLevel>4</WarningLevel>
33
+  </PropertyGroup>
34
+  <ItemGroup>
35
+    <Reference Include="System" />
36
+    <Reference Include="System.Core" />
37
+    <Reference Include="System.Xml.Linq" />
38
+    <Reference Include="System.Data.DataSetExtensions" />
39
+    <Reference Include="Microsoft.CSharp" />
40
+    <Reference Include="System.Data" />
41
+    <Reference Include="System.Deployment" />
42
+    <Reference Include="System.Drawing" />
43
+    <Reference Include="System.Net.Http" />
44
+    <Reference Include="System.Windows.Forms" />
45
+    <Reference Include="System.Xml" />
46
+  </ItemGroup>
47
+  <ItemGroup>
48
+    <Compile Include="Form1.cs">
49
+      <SubType>Form</SubType>
50
+    </Compile>
51
+    <Compile Include="Form1.Designer.cs">
52
+      <DependentUpon>Form1.cs</DependentUpon>
53
+    </Compile>
54
+    <Compile Include="Program.cs" />
55
+    <Compile Include="Properties\AssemblyInfo.cs" />
56
+    <EmbeddedResource Include="Form1.resx">
57
+      <DependentUpon>Form1.cs</DependentUpon>
58
+    </EmbeddedResource>
59
+    <EmbeddedResource Include="Properties\Resources.resx">
60
+      <Generator>ResXFileCodeGenerator</Generator>
61
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
62
+      <SubType>Designer</SubType>
63
+    </EmbeddedResource>
64
+    <Compile Include="Properties\Resources.Designer.cs">
65
+      <AutoGen>True</AutoGen>
66
+      <DependentUpon>Resources.resx</DependentUpon>
67
+    </Compile>
68
+    <None Include="Properties\Settings.settings">
69
+      <Generator>SettingsSingleFileGenerator</Generator>
70
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
71
+    </None>
72
+    <Compile Include="Properties\Settings.Designer.cs">
73
+      <AutoGen>True</AutoGen>
74
+      <DependentUpon>Settings.settings</DependentUpon>
75
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
76
+    </Compile>
77
+  </ItemGroup>
78
+  <ItemGroup>
79
+    <None Include="App.config" />
80
+  </ItemGroup>
81
+  <ItemGroup>
82
+    <ProjectReference Include="..\MathEx\MathEx.csproj">
83
+      <Project>{fe22bb43-5c91-451e-8e5c-08d02aa4b080}</Project>
84
+      <Name>MathEx</Name>
85
+    </ProjectReference>
86
+  </ItemGroup>
87
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
88
+</Project>

+ 22
- 0
MathExExample/Program.cs View File

@@ -0,0 +1,22 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+using System.Windows.Forms;
6
+
7
+namespace MathExExample
8
+{
9
+	static class Program
10
+	{
11
+		/// <summary>
12
+		/// The main entry point for the application.
13
+		/// </summary>
14
+		[STAThread]
15
+		static void Main()
16
+		{
17
+			Application.EnableVisualStyles();
18
+			Application.SetCompatibleTextRenderingDefault(false);
19
+			Application.Run(new Form1());
20
+		}
21
+	}
22
+}

+ 36
- 0
MathExExample/Properties/AssemblyInfo.cs View File

@@ -0,0 +1,36 @@
1
+using System.Reflection;
2
+using System.Runtime.CompilerServices;
3
+using System.Runtime.InteropServices;
4
+
5
+// General Information about an assembly is controlled through the following
6
+// set of attributes. Change these attribute values to modify the information
7
+// associated with an assembly.
8
+[assembly: AssemblyTitle("MathExExample")]
9
+[assembly: AssemblyDescription("")]
10
+[assembly: AssemblyConfiguration("")]
11
+[assembly: AssemblyCompany("")]
12
+[assembly: AssemblyProduct("MathExExample")]
13
+[assembly: AssemblyCopyright("Copyright ©  2017")]
14
+[assembly: AssemblyTrademark("")]
15
+[assembly: AssemblyCulture("")]
16
+
17
+// Setting ComVisible to false makes the types in this assembly not visible
18
+// to COM components.  If you need to access a type in this assembly from
19
+// COM, set the ComVisible attribute to true on that type.
20
+[assembly: ComVisible(false)]
21
+
22
+// The following GUID is for the ID of the typelib if this project is exposed to COM
23
+[assembly: Guid("14b091f4-f22e-43ee-b6ae-1453db9ae246")]
24
+
25
+// Version information for an assembly consists of the following four values:
26
+//
27
+//      Major Version
28
+//      Minor Version
29
+//      Build Number
30
+//      Revision
31
+//
32
+// You can specify all the values or you can default the Build and Revision Numbers
33
+// by using the '*' as shown below:
34
+// [assembly: AssemblyVersion("1.0.*")]
35
+[assembly: AssemblyVersion("1.0.0.0")]
36
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71
- 0
MathExExample/Properties/Resources.Designer.cs View File

@@ -0,0 +1,71 @@
1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     This code was generated by a tool.
4
+//     Runtime Version:4.0.30319.42000
5
+//
6
+//     Changes to this file may cause incorrect behavior and will be lost if
7
+//     the code is regenerated.
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+namespace MathExExample.Properties
12
+{
13
+
14
+
15
+	/// <summary>
16
+	///   A strongly-typed resource class, for looking up localized strings, etc.
17
+	/// </summary>
18
+	// This class was auto-generated by the StronglyTypedResourceBuilder
19
+	// class via a tool like ResGen or Visual Studio.
20
+	// To add or remove a member, edit your .ResX file then rerun ResGen
21
+	// with the /str option, or rebuild your VS project.
22
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23
+	[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24
+	[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25
+	internal class Resources
26
+	{
27
+
28
+		private static global::System.Resources.ResourceManager resourceMan;
29
+
30
+		private static global::System.Globalization.CultureInfo resourceCulture;
31
+
32
+		[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33
+		internal Resources()
34
+		{
35
+		}
36
+
37
+		/// <summary>
38
+		///   Returns the cached ResourceManager instance used by this class.
39
+		/// </summary>
40
+		[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41
+		internal static global::System.Resources.ResourceManager ResourceManager
42
+		{
43
+			get
44
+			{
45
+				if ((resourceMan == null))
46
+				{
47
+					global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MathExExample.Properties.Resources", typeof(Resources).Assembly);
48
+					resourceMan = temp;
49
+				}
50
+				return resourceMan;
51
+			}
52
+		}
53
+
54
+		/// <summary>
55
+		///   Overrides the current thread's CurrentUICulture property for all
56
+		///   resource lookups using this strongly typed resource class.
57
+		/// </summary>
58
+		[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59
+		internal static global::System.Globalization.CultureInfo Culture
60
+		{
61
+			get
62
+			{
63
+				return resourceCulture;
64
+			}
65
+			set
66
+			{
67
+				resourceCulture = value;
68
+			}
69
+		}
70
+	}
71
+}

+ 117
- 0
MathExExample/Properties/Resources.resx View File

@@ -0,0 +1,117 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:element name="root" msdata:IsDataSet="true">
64
+      <xsd:complexType>
65
+        <xsd:choice maxOccurs="unbounded">
66
+          <xsd:element name="metadata">
67
+            <xsd:complexType>
68
+              <xsd:sequence>
69
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
70
+              </xsd:sequence>
71
+              <xsd:attribute name="name" type="xsd:string" />
72
+              <xsd:attribute name="type" type="xsd:string" />
73
+              <xsd:attribute name="mimetype" type="xsd:string" />
74
+            </xsd:complexType>
75
+          </xsd:element>
76
+          <xsd:element name="assembly">
77
+            <xsd:complexType>
78
+              <xsd:attribute name="alias" type="xsd:string" />
79
+              <xsd:attribute name="name" type="xsd:string" />
80
+            </xsd:complexType>
81
+          </xsd:element>
82
+          <xsd:element name="data">
83
+            <xsd:complexType>
84
+              <xsd:sequence>
85
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87
+              </xsd:sequence>
88
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91
+            </xsd:complexType>
92
+          </xsd:element>
93
+          <xsd:element name="resheader">
94
+            <xsd:complexType>
95
+              <xsd:sequence>
96
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97
+              </xsd:sequence>
98
+              <xsd:attribute name="name" type="xsd:string" use="required" />
99
+            </xsd:complexType>
100
+          </xsd:element>
101
+        </xsd:choice>
102
+      </xsd:complexType>
103
+    </xsd:element>
104
+  </xsd:schema>
105
+  <resheader name="resmimetype">
106
+    <value>text/microsoft-resx</value>
107
+  </resheader>
108
+  <resheader name="version">
109
+    <value>2.0</value>
110
+  </resheader>
111
+  <resheader name="reader">
112
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113
+  </resheader>
114
+  <resheader name="writer">
115
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+</root>

+ 30
- 0
MathExExample/Properties/Settings.Designer.cs View File

@@ -0,0 +1,30 @@
1
+//------------------------------------------------------------------------------
2
+// <auto-generated>
3
+//     This code was generated by a tool.
4
+//     Runtime Version:4.0.30319.42000
5
+//
6
+//     Changes to this file may cause incorrect behavior and will be lost if
7
+//     the code is regenerated.
8
+// </auto-generated>
9
+//------------------------------------------------------------------------------
10
+
11
+namespace MathExExample.Properties
12
+{
13
+
14
+
15
+	[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17
+	internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18
+	{
19
+
20
+		private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21
+
22
+		public static Settings Default
23
+		{
24
+			get
25
+			{
26
+				return defaultInstance;
27
+			}
28
+		}
29
+	}
30
+}

+ 7
- 0
MathExExample/Properties/Settings.settings View File

@@ -0,0 +1,7 @@
1
+<?xml version='1.0' encoding='utf-8'?>
2
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3
+  <Profiles>
4
+    <Profile Name="(Default)" />
5
+  </Profiles>
6
+  <Settings />
7
+</SettingsFile>