C# and WPF tutorial files

This commit is contained in:
Unknown
2017-05-29 21:01:07 +01:00
parent dfdd754362
commit 1cb838df3a
107 changed files with 5760 additions and 0 deletions

View File

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

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0FB8FF87-B543-44CE-BE5C-9E6EE23AC755}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BasicCalculator</RootNamespace>
<AssemblyName>BasicCalculator</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Operation.cs" />
<Compile Include="OperationType.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicCalculator", "BasicCalculator.csproj", "{0FB8FF87-B543-44CE-BE5C-9E6EE23AC755}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0FB8FF87-B543-44CE-BE5C-9E6EE23AC755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FB8FF87-B543-44CE-BE5C-9E6EE23AC755}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FB8FF87-B543-44CE-BE5C-9E6EE23AC755}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FB8FF87-B543-44CE-BE5C-9E6EE23AC755}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,356 @@
namespace BasicCalculator
{
partial class Form1
{
/// <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.UserInputText = new System.Windows.Forms.TextBox();
this.CalculationResultText = new System.Windows.Forms.Label();
this.ButtonsPanel = new System.Windows.Forms.TableLayoutPanel();
this.EqualsButton = new System.Windows.Forms.Button();
this.DotButton = new System.Windows.Forms.Button();
this.ZeroButton = new System.Windows.Forms.Button();
this.PlusButton = new System.Windows.Forms.Button();
this.ThreeButton = new System.Windows.Forms.Button();
this.TwoButton = new System.Windows.Forms.Button();
this.OneButton = new System.Windows.Forms.Button();
this.MinusButton = new System.Windows.Forms.Button();
this.SixButton = new System.Windows.Forms.Button();
this.FiveButton = new System.Windows.Forms.Button();
this.FourButton = new System.Windows.Forms.Button();
this.TimesButton = new System.Windows.Forms.Button();
this.NineButton = new System.Windows.Forms.Button();
this.EightButton = new System.Windows.Forms.Button();
this.SevenButton = new System.Windows.Forms.Button();
this.DivideButton = new System.Windows.Forms.Button();
this.DelButton = new System.Windows.Forms.Button();
this.CEButton = new System.Windows.Forms.Button();
this.ButtonsPanel.SuspendLayout();
this.SuspendLayout();
//
// UserInputText
//
this.UserInputText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.UserInputText.Location = new System.Drawing.Point(11, 12);
this.UserInputText.Name = "UserInputText";
this.UserInputText.Size = new System.Drawing.Size(578, 29);
this.UserInputText.TabIndex = 0;
//
// CalculationResultText
//
this.CalculationResultText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CalculationResultText.Location = new System.Drawing.Point(11, 54);
this.CalculationResultText.Name = "CalculationResultText";
this.CalculationResultText.Size = new System.Drawing.Size(578, 77);
this.CalculationResultText.TabIndex = 1;
this.CalculationResultText.Text = "Please enter an equation and press enter or =";
//
// ButtonsPanel
//
this.ButtonsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ButtonsPanel.ColumnCount = 4;
this.ButtonsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.ButtonsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.ButtonsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.ButtonsPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.ButtonsPanel.Controls.Add(this.EqualsButton, 3, 4);
this.ButtonsPanel.Controls.Add(this.DotButton, 2, 4);
this.ButtonsPanel.Controls.Add(this.ZeroButton, 1, 4);
this.ButtonsPanel.Controls.Add(this.PlusButton, 3, 3);
this.ButtonsPanel.Controls.Add(this.ThreeButton, 2, 3);
this.ButtonsPanel.Controls.Add(this.TwoButton, 1, 3);
this.ButtonsPanel.Controls.Add(this.OneButton, 0, 3);
this.ButtonsPanel.Controls.Add(this.MinusButton, 3, 2);
this.ButtonsPanel.Controls.Add(this.SixButton, 2, 2);
this.ButtonsPanel.Controls.Add(this.FiveButton, 1, 2);
this.ButtonsPanel.Controls.Add(this.FourButton, 0, 2);
this.ButtonsPanel.Controls.Add(this.TimesButton, 3, 1);
this.ButtonsPanel.Controls.Add(this.NineButton, 2, 1);
this.ButtonsPanel.Controls.Add(this.EightButton, 1, 1);
this.ButtonsPanel.Controls.Add(this.SevenButton, 0, 1);
this.ButtonsPanel.Controls.Add(this.DivideButton, 3, 0);
this.ButtonsPanel.Controls.Add(this.DelButton, 2, 0);
this.ButtonsPanel.Controls.Add(this.CEButton, 0, 0);
this.ButtonsPanel.Location = new System.Drawing.Point(16, 134);
this.ButtonsPanel.Name = "ButtonsPanel";
this.ButtonsPanel.RowCount = 5;
this.ButtonsPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.ButtonsPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.ButtonsPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.ButtonsPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.ButtonsPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.ButtonsPanel.Size = new System.Drawing.Size(573, 486);
this.ButtonsPanel.TabIndex = 2;
//
// EqualsButton
//
this.EqualsButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.EqualsButton.Location = new System.Drawing.Point(432, 391);
this.EqualsButton.Name = "EqualsButton";
this.EqualsButton.Size = new System.Drawing.Size(138, 92);
this.EqualsButton.TabIndex = 19;
this.EqualsButton.Text = "=";
this.EqualsButton.UseVisualStyleBackColor = true;
this.EqualsButton.Click += new System.EventHandler(this.EqualsButton_Click);
//
// DotButton
//
this.DotButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.DotButton.Location = new System.Drawing.Point(289, 391);
this.DotButton.Name = "DotButton";
this.DotButton.Size = new System.Drawing.Size(137, 92);
this.DotButton.TabIndex = 18;
this.DotButton.Text = ".";
this.DotButton.UseVisualStyleBackColor = true;
this.DotButton.Click += new System.EventHandler(this.DotButton_Click);
//
// ZeroButton
//
this.ZeroButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.ZeroButton.Location = new System.Drawing.Point(146, 391);
this.ZeroButton.Name = "ZeroButton";
this.ZeroButton.Size = new System.Drawing.Size(137, 92);
this.ZeroButton.TabIndex = 17;
this.ZeroButton.Text = "0";
this.ZeroButton.UseVisualStyleBackColor = true;
this.ZeroButton.Click += new System.EventHandler(this.ZeroButton_Click);
//
// PlusButton
//
this.PlusButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.PlusButton.Location = new System.Drawing.Point(432, 294);
this.PlusButton.Name = "PlusButton";
this.PlusButton.Size = new System.Drawing.Size(138, 91);
this.PlusButton.TabIndex = 15;
this.PlusButton.Text = "+";
this.PlusButton.UseVisualStyleBackColor = true;
this.PlusButton.Click += new System.EventHandler(this.PlusButton_Click);
//
// ThreeButton
//
this.ThreeButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.ThreeButton.Location = new System.Drawing.Point(289, 294);
this.ThreeButton.Name = "ThreeButton";
this.ThreeButton.Size = new System.Drawing.Size(137, 91);
this.ThreeButton.TabIndex = 14;
this.ThreeButton.Text = "3";
this.ThreeButton.UseVisualStyleBackColor = true;
this.ThreeButton.Click += new System.EventHandler(this.ThreeButton_Click);
//
// TwoButton
//
this.TwoButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.TwoButton.Location = new System.Drawing.Point(146, 294);
this.TwoButton.Name = "TwoButton";
this.TwoButton.Size = new System.Drawing.Size(137, 91);
this.TwoButton.TabIndex = 13;
this.TwoButton.Text = "2";
this.TwoButton.UseVisualStyleBackColor = true;
this.TwoButton.Click += new System.EventHandler(this.TwoButton_Click);
//
// OneButton
//
this.OneButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.OneButton.Location = new System.Drawing.Point(3, 294);
this.OneButton.Name = "OneButton";
this.OneButton.Size = new System.Drawing.Size(137, 91);
this.OneButton.TabIndex = 12;
this.OneButton.Text = "1";
this.OneButton.UseVisualStyleBackColor = true;
this.OneButton.Click += new System.EventHandler(this.OneButton_Click);
//
// MinusButton
//
this.MinusButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.MinusButton.Location = new System.Drawing.Point(432, 197);
this.MinusButton.Name = "MinusButton";
this.MinusButton.Size = new System.Drawing.Size(138, 91);
this.MinusButton.TabIndex = 11;
this.MinusButton.Text = "-";
this.MinusButton.UseVisualStyleBackColor = true;
this.MinusButton.Click += new System.EventHandler(this.MinusButton_Click);
//
// SixButton
//
this.SixButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.SixButton.Location = new System.Drawing.Point(289, 197);
this.SixButton.Name = "SixButton";
this.SixButton.Size = new System.Drawing.Size(137, 91);
this.SixButton.TabIndex = 10;
this.SixButton.Text = "6";
this.SixButton.UseVisualStyleBackColor = true;
this.SixButton.Click += new System.EventHandler(this.SixButton_Click);
//
// FiveButton
//
this.FiveButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.FiveButton.Location = new System.Drawing.Point(146, 197);
this.FiveButton.Name = "FiveButton";
this.FiveButton.Size = new System.Drawing.Size(137, 91);
this.FiveButton.TabIndex = 9;
this.FiveButton.Text = "5";
this.FiveButton.UseVisualStyleBackColor = true;
this.FiveButton.Click += new System.EventHandler(this.FiveButton_Click);
//
// FourButton
//
this.FourButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.FourButton.Location = new System.Drawing.Point(3, 197);
this.FourButton.Name = "FourButton";
this.FourButton.Size = new System.Drawing.Size(137, 91);
this.FourButton.TabIndex = 8;
this.FourButton.Text = "4";
this.FourButton.UseVisualStyleBackColor = true;
this.FourButton.Click += new System.EventHandler(this.FourButton_Click);
//
// TimesButton
//
this.TimesButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.TimesButton.Location = new System.Drawing.Point(432, 100);
this.TimesButton.Name = "TimesButton";
this.TimesButton.Size = new System.Drawing.Size(138, 91);
this.TimesButton.TabIndex = 7;
this.TimesButton.Text = "X";
this.TimesButton.UseVisualStyleBackColor = true;
this.TimesButton.Click += new System.EventHandler(this.TimesButton_Click);
//
// NineButton
//
this.NineButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.NineButton.Location = new System.Drawing.Point(289, 100);
this.NineButton.Name = "NineButton";
this.NineButton.Size = new System.Drawing.Size(137, 91);
this.NineButton.TabIndex = 6;
this.NineButton.Text = "9";
this.NineButton.UseVisualStyleBackColor = true;
this.NineButton.Click += new System.EventHandler(this.NineButton_Click);
//
// EightButton
//
this.EightButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.EightButton.Location = new System.Drawing.Point(146, 100);
this.EightButton.Name = "EightButton";
this.EightButton.Size = new System.Drawing.Size(137, 91);
this.EightButton.TabIndex = 5;
this.EightButton.Text = "8";
this.EightButton.UseVisualStyleBackColor = true;
this.EightButton.Click += new System.EventHandler(this.EightButton_Click);
//
// SevenButton
//
this.SevenButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.SevenButton.Location = new System.Drawing.Point(3, 100);
this.SevenButton.Name = "SevenButton";
this.SevenButton.Size = new System.Drawing.Size(137, 91);
this.SevenButton.TabIndex = 4;
this.SevenButton.Text = "7";
this.SevenButton.UseVisualStyleBackColor = true;
this.SevenButton.Click += new System.EventHandler(this.SevenButton_Click);
//
// DivideButton
//
this.DivideButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.DivideButton.Location = new System.Drawing.Point(432, 3);
this.DivideButton.Name = "DivideButton";
this.DivideButton.Size = new System.Drawing.Size(138, 91);
this.DivideButton.TabIndex = 3;
this.DivideButton.Text = "%";
this.DivideButton.UseVisualStyleBackColor = true;
this.DivideButton.Click += new System.EventHandler(this.DivideButton_Click);
//
// DelButton
//
this.DelButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.DelButton.Location = new System.Drawing.Point(289, 3);
this.DelButton.Name = "DelButton";
this.DelButton.Size = new System.Drawing.Size(137, 91);
this.DelButton.TabIndex = 2;
this.DelButton.Text = "Del";
this.DelButton.UseVisualStyleBackColor = true;
this.DelButton.Click += new System.EventHandler(this.DelButton_Click);
//
// CEButton
//
this.CEButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CEButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.CEButton.Location = new System.Drawing.Point(3, 3);
this.CEButton.Name = "CEButton";
this.CEButton.Size = new System.Drawing.Size(137, 91);
this.CEButton.TabIndex = 0;
this.CEButton.Text = "CE";
this.CEButton.UseVisualStyleBackColor = true;
this.CEButton.Click += new System.EventHandler(this.CEButton_Click);
//
// Form1
//
this.AcceptButton = this.EqualsButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.CEButton;
this.ClientSize = new System.Drawing.Size(600, 632);
this.Controls.Add(this.ButtonsPanel);
this.Controls.Add(this.CalculationResultText);
this.Controls.Add(this.UserInputText);
this.MinimumSize = new System.Drawing.Size(460, 502);
this.Name = "Form1";
this.Text = "Basic Calculator";
this.ButtonsPanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox UserInputText;
private System.Windows.Forms.Label CalculationResultText;
private System.Windows.Forms.TableLayoutPanel ButtonsPanel;
private System.Windows.Forms.Button CEButton;
private System.Windows.Forms.Button EqualsButton;
private System.Windows.Forms.Button DotButton;
private System.Windows.Forms.Button ZeroButton;
private System.Windows.Forms.Button PlusButton;
private System.Windows.Forms.Button ThreeButton;
private System.Windows.Forms.Button TwoButton;
private System.Windows.Forms.Button OneButton;
private System.Windows.Forms.Button MinusButton;
private System.Windows.Forms.Button SixButton;
private System.Windows.Forms.Button FiveButton;
private System.Windows.Forms.Button FourButton;
private System.Windows.Forms.Button TimesButton;
private System.Windows.Forms.Button NineButton;
private System.Windows.Forms.Button EightButton;
private System.Windows.Forms.Button SevenButton;
private System.Windows.Forms.Button DivideButton;
private System.Windows.Forms.Button DelButton;
}
}

View File

@ -0,0 +1,542 @@
using System;
using System.Linq;
using System.Windows.Forms;
namespace BasicCalculator
{
/// <summary>
/// A basic calculator
/// </summary>
public partial class Form1 : Form
{
#region Constructor
/// <summary>
/// Default constructor
/// </summary>
public Form1()
{
InitializeComponent();
}
#endregion
#region Clearing Methods
/// <summary>
/// Clears the user input text
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void CEButton_Click(object sender, EventArgs e)
{
// Clears the text from the user input text box
this.UserInputText.Text = string.Empty;
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Deletes the first character in front of the cursor
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void DelButton_Click(object sender, EventArgs e)
{
// Delete the value after the selected position
DeleteTextValue();
// Focus the user input text
FocusInputText();
}
#endregion
#region Operator Methods
/// <summary>
/// Adds the Divide character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void DivideButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("/");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the Times character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void TimesButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("*");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the Minus character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void MinusButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("-");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the Plus character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void PlusButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("+");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Calculates the given equation in the user input text
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void EqualsButton_Click(object sender, EventArgs e)
{
// Calculate the equation
CalculateEquation();
// Focus the user input text
FocusInputText();
}
#endregion
#region Number Methods
/// <summary>
/// Adds the . character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void DotButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue(".");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 0 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void ZeroButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("0");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 1 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void OneButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("1");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 2 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void TwoButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("2");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 3 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void ThreeButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("3");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 4 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void FourButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("4");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 5 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void FiveButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("5");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 6 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void SixButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("6");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 7 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void SevenButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("7");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 8 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void EightButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("8");
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Adds the 9 character to the text at the currently selection position
/// </summary>
/// <param name="sender">The event sender</param>
/// <param name="e">The event arguments</param>
private void NineButton_Click(object sender, EventArgs e)
{
// Insert the value in the user input text box at the currently selected position
InsertTextValue("9");
// Focus the user input text
FocusInputText();
}
#endregion
/// <summary>
/// Calculates the given equation and outputs the answer to the user label
/// </summary>
private void CalculateEquation()
{
// 1. Enums
// 2. New classes
// 3. For loops
// 4. try/catch
// 5. Recursive functions
// 6. Switch statements
this.CalculationResultText.Text = ParseOperation();
// Focus the user input text
FocusInputText();
}
/// <summary>
/// Parses the users equation and calculates the result
/// </summary>
/// <returns></returns>
private string ParseOperation()
{
try
{
// Get the users equation input
var input = this.UserInputText.Text;
// Remove all spaces
input = input.Replace(" ", "");
// Create a new top-level operation
var operation = new Operation();
var leftSide = true;
// Loop through each character of the input
// starting from the left working to the right
for (int i = 0; i < input.Length; i++)
{
// TODO: Handle order priority
// 4.2 + 5.7 * 3
// It should calculate 5 * 3 first, then 4 + the result (so 4 + 15)
// Check if the current character is a number
if ("0123456789.".Any(c => input[i] == c))
{
if (leftSide)
operation.LeftSide = AddNumberPart(operation.LeftSide, input[i]);
else
operation.RightSide = AddNumberPart(operation.RightSide, input[i]);
}
// If it is an operator ( + - * / ) set the operator type
else if ("+-*/".Any(c => input[i] == c))
{
// If we are on the right side already, we now need to calculate our current operation
// and set the result to the left side of the next operation
if (!leftSide)
{
// Get the operator type
var operatorType = GetOperationType(input[i]);
// Check if we actually have a right side number
if (operation.RightSide.Length == 0)
{
// Check the operator is not a minus (as they could be creating a negative number)
if (operatorType != OperationType.Minus)
throw new InvalidOperationException($"Operator (+ * / or more than one -) specified without an right side number");
// If we got here, the operator type is a minus, and there is no left number currently, so add the minus to the number
operation.RightSide += input[i];
}
else
{
// Calculate previous equation and set to the left side
operation.LeftSide = CalculateOperation(operation);
// Set new operator
operation.OperationType = operatorType;
// Clear the previous right number
operation.RightSide = string.Empty;
}
}
else
{
// Get the operator type
var operatorType = GetOperationType(input[i]);
// Check if we actually have a left side number
if (operation.LeftSide.Length == 0)
{
// Check the operator is not a minus (as they could be creating a negative number)
if (operatorType != OperationType.Minus)
throw new InvalidOperationException($"Operator (+ * / or more than one -) specified without an left side number");
// If we got here, the operator type is a minus, and there is no left number currently, so add the minus to the number
operation.LeftSide += input[i];
}
else
{
// If we get here, we have a left number and now an operator, so we want to move to the right side
// Set the operation type
operation.OperationType = operatorType;
// Move to the right side
leftSide = false;
}
}
}
}
// If we are done parsing, and there were no exceptions
// calculate the current operation
return CalculateOperation(operation);
}
catch (Exception ex)
{
return $"Invalid equation. {ex.Message}";
}
}
/// <summary>
/// Calculates an <see cref="Operation"/> and returns the result
/// </summary>
/// <param name="operation">The operation to calculate</param>
private string CalculateOperation(Operation operation)
{
// Store the number values of the string representations
decimal left = 0;
decimal right = 0;
// Check if we have a valid left side number
if (string.IsNullOrEmpty(operation.LeftSide) || !decimal.TryParse(operation.LeftSide, out left))
throw new InvalidOperationException($"Left side of the operation was not a number. {operation.LeftSide}");
// Check if we have a valid right side number
if (string.IsNullOrEmpty(operation.RightSide) || !decimal.TryParse(operation.RightSide, out right))
throw new InvalidOperationException($"Right side of the operation was not a number. {operation.RightSide}");
try
{
switch (operation.OperationType)
{
case OperationType.Add:
return (left + right).ToString();
case OperationType.Minus:
return (left - right).ToString();
case OperationType.Divide:
return (left / right).ToString();
case OperationType.Multiply:
return (left * right).ToString();
default:
throw new InvalidOperationException($"Unknown operator type when calculating operation. { operation.OperationType }");
}
}
catch (Exception ex)
{
throw new InvalidOperationException($"Failed to calculate operation {operation.LeftSide} {operation.OperationType} {operation.RightSide}. {ex.Message}");
}
}
/// <summary>
/// Accepts a character and returns the known <see cref="OperationType"/>
/// </summary>
/// <param name="character">The character to parse</param>
/// <returns></returns>
private OperationType GetOperationType(char character)
{
switch (character)
{
case '+':
return OperationType.Add;
case '-':
return OperationType.Minus;
case '/':
return OperationType.Divide;
case '*':
return OperationType.Multiply;
default:
throw new InvalidOperationException($"Unknown operator type { character }");
}
}
/// <summary>
/// Attempts to add a new character to the current number, checking for valid characters as it goes
/// </summary>
/// <param name="currentNumber">The current number string</param>
/// <param name="newCharacter">The new character to append to the string</param>
/// <returns></returns>
private string AddNumberPart(string currentNumber, char newCharacter)
{
// Check if there is already a . in the number
if (newCharacter == '.' && currentNumber.Contains('.'))
throw new InvalidOperationException($"Number {currentNumber} already contains a . and another cannot be added");
return currentNumber + newCharacter;
}
#region Private Helpers
/// <summary>
/// Focuses the user input text
/// </summary>
private void FocusInputText()
{
this.UserInputText.Focus();
}
/// <summary>
/// Inserts the given text into the user input text box
/// </summary>
/// <param name="value">The value to insert</param>
private void InsertTextValue(string value)
{
// Remember selection start
var selectionStart = this.UserInputText.SelectionStart;
// Set new text
this.UserInputText.Text = this.UserInputText.Text.Insert(this.UserInputText.SelectionStart, value);
// Restore the selection start
this.UserInputText.SelectionStart = selectionStart + value.Length;
// Set selection length to zero
this.UserInputText.SelectionLength = 0;
}
/// <summary>
/// Deletes the character to the right of the selection start of the user input text box
/// </summary>
private void DeleteTextValue()
{
// If we don't have a value to delete, return
if (this.UserInputText.Text.Length < this.UserInputText.SelectionStart + 1)
return;
// Remember selection start
var selectionStart = this.UserInputText.SelectionStart;
// Delete the character to the right of the selection
this.UserInputText.Text = this.UserInputText.Text.Remove(this.UserInputText.SelectionStart, 1);
// Restore the selection start
this.UserInputText.SelectionStart = selectionStart;
// Set selection length to zero
this.UserInputText.SelectionLength = 0;
}
#endregion
}
}

View File

@ -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>

View File

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BasicCalculator
{
/// <summary>
/// Holds information about a single calculator operation
/// </summary>
public class Operation
{
#region Public Properties
/// <summary>
/// The left side of the operation
/// </summary>
public string LeftSide { get; set; }
/// <summary>
/// The right side of the operation
/// </summary>
public string RightSide { get; set; }
/// <summary>
/// The type of operation to perform
/// </summary>
public OperationType OperationType { get; set; }
/// <summary>
/// The inner operation to be performed initially before this operation
/// </summary>
public Operation InnerOperation { get; set; }
#endregion
#region Constructor
/// <summary>
/// Default constructor
/// </summary>
public Operation()
{
// Create empty strings instead of having nulls
this.LeftSide = string.Empty;
this.RightSide = string.Empty;
}
#endregion
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BasicCalculator
{
/// <summary>
/// A type of operation the calculator can perform
/// </summary>
public enum OperationType
{
/// <summary>
/// Adds two values together
/// </summary>
Add,
/// <summary>
/// Takes one value from another
/// </summary>
Minus,
/// <summary>
/// Divides one number by another
/// </summary>
Divide,
/// <summary>
/// Multiplies two numbers together
/// </summary>
Multiply
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BasicCalculator
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BasicCalculator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BasicCalculator")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0fb8ff87-b543-44ce-be5c-9e6ee23ac755")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BasicCalculator.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BasicCalculator.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BasicCalculator.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

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