REEEEEEEE
This commit is contained in:
parent
aecbff962d
commit
6d6f75a4d2
BIN
.vs/BaseConverter/FileContentIndex/39f90cb6-50fa-48af-a8cc-ff8fef254c4e.vsidx
Executable file
BIN
.vs/BaseConverter/FileContentIndex/39f90cb6-50fa-48af-a8cc-ff8fef254c4e.vsidx
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -23,6 +23,7 @@ using System.Data;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
|
||||||
@ -37,25 +38,27 @@ namespace WindowsFormsApplication1
|
|||||||
toolTip.SetToolTip(autoCompute, "Automatically computes input based on changes made to textbox contents.");
|
toolTip.SetToolTip(autoCompute, "Automatically computes input based on changes made to textbox contents.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
int paddingOffset = 0, spacingOffset = 0, i = 0;
|
||||||
private void compute()
|
public void compute()
|
||||||
{
|
{
|
||||||
// Define variables
|
// Define variables
|
||||||
long decimalNum = 0, hexNum = 0, binNum = 0, octalNum = 0;
|
long decimalNum = 0, hexNum = 0, binNum = 0, octalNum = 0;
|
||||||
int paddingOffset = 0,spacingOffset = 0, i = 0;
|
//int paddingOffset = 0,spacingOffset = 0, i = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
{ // Extract data from text boxes.
|
{ // Extract data from text boxes.
|
||||||
|
|
||||||
decimalNum = long.Parse(decimalTextBox.Text);
|
decimalNum = long.Parse(decimalTextBox.Text);
|
||||||
hexNum = Convert.ToInt64(hexTextBox.Text, 16);
|
|
||||||
// Remove spacing from binaryTextBox before parsing it
|
|
||||||
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
|
||||||
binNum = Convert.ToInt64(binaryTextBox.Text, 2);
|
binNum = Convert.ToInt64(binaryTextBox.Text, 2);
|
||||||
|
|
||||||
|
hexNum = Convert.ToInt64(hexTextBox.Text, 16);
|
||||||
octalNum = Convert.ToInt64(octalTextBox.Text, 8);
|
octalNum = Convert.ToInt64(octalTextBox.Text, 8);
|
||||||
paddingOffset = int.Parse(paddingOffsetTextBox.Text);
|
paddingOffset = int.Parse(paddingOffsetTextBox.Text);
|
||||||
spacingOffset = int.Parse(spacingOffsetTextBox.Text);
|
|
||||||
}
|
}
|
||||||
catch (Exception Ex)
|
catch
|
||||||
{
|
{
|
||||||
clearTextboxes();
|
clearTextboxes();
|
||||||
MessageBox.Show("Invalid number entered into one of the textboxes!");
|
MessageBox.Show("Invalid number entered into one of the textboxes!");
|
||||||
@ -120,9 +123,17 @@ namespace WindowsFormsApplication1
|
|||||||
{
|
{
|
||||||
binaryTextBox.Text = Convert.ToString(binNum, 2);
|
binaryTextBox.Text = Convert.ToString(binNum, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hexTextBox.Text = hexNum.ToString("X");
|
||||||
|
octalTextBox.Text = Convert.ToString(octalNum, 8);
|
||||||
|
decimalTextBox.Text = decimalNum.ToString();
|
||||||
|
}
|
||||||
|
public void spacing()
|
||||||
|
{
|
||||||
|
spacingOffset = int.Parse(spacingOffsetTextBox.Text);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (spacingToggle.Checked)
|
if (spacingToggle.Checked)
|
||||||
{
|
{
|
||||||
string binaryString = binaryTextBox.Text; // Define string to offset
|
string binaryString = binaryTextBox.Text; // Define string to offset
|
||||||
int binarySize = binaryString.Length; //count the length of the string.
|
int binarySize = binaryString.Length; //count the length of the string.
|
||||||
@ -144,15 +155,14 @@ namespace WindowsFormsApplication1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
binaryTextBox.Text = builder.ToString();
|
binaryTextBox.Text = builder.ToString();
|
||||||
builder = null; // null out builder when done
|
//builder = null; // null out builder when done
|
||||||
//binaryTextBox.Text = binaryString;
|
//binaryTextBox.Text = binaryString;
|
||||||
}
|
}
|
||||||
} catch (Exception Ex) {
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
MessageBox.Show("Divide by zero");
|
MessageBox.Show("Divide by zero");
|
||||||
}
|
}
|
||||||
hexTextBox.Text = hexNum.ToString("X");
|
|
||||||
octalTextBox.Text = Convert.ToString(octalNum, 8);
|
|
||||||
decimalTextBox.Text = decimalNum.ToString();
|
|
||||||
}
|
}
|
||||||
private void currentFocus(string focusOn)
|
private void currentFocus(string focusOn)
|
||||||
{
|
{
|
||||||
@ -186,7 +196,12 @@ namespace WindowsFormsApplication1
|
|||||||
|
|
||||||
private void computeButton_Click(object sender, EventArgs e)
|
private void computeButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// Remove commas from decimalTextBox before parsing it
|
||||||
|
decimalTextBox.Text = decimalTextBox.Text.Replace(",", "");
|
||||||
|
// Remove spacing from binaryTextBox before parsing it
|
||||||
|
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
||||||
compute();
|
compute();
|
||||||
|
spacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearButton_Click(object sender, EventArgs e)
|
private void clearButton_Click(object sender, EventArgs e)
|
||||||
@ -234,28 +249,61 @@ namespace WindowsFormsApplication1
|
|||||||
{
|
{
|
||||||
//debugLabel.Text = sender.GetType().ToString();
|
//debugLabel.Text = sender.GetType().ToString();
|
||||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||||
|
{
|
||||||
|
// Remove commas from decimalTextBox before parsing it
|
||||||
|
//decimalTextBox.Text = decimalTextBox.Text.Replace(",", "");
|
||||||
|
// Remove spacing from binaryTextBox before parsing it
|
||||||
|
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
||||||
compute();
|
compute();
|
||||||
|
//spacing();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hexTextBox_TextChanged(object sender, EventArgs e)
|
private void hexTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//debugLabel.Text = sender.GetType().ToString();
|
//debugLabel.Text = sender.GetType().ToString();
|
||||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||||
compute();
|
{
|
||||||
}
|
// Remove commas from decimalTextBox before parsing it
|
||||||
|
decimalTextBox.Text = decimalTextBox.Text.Replace(",", "");
|
||||||
|
// Remove spacing from binaryTextBox before parsing it
|
||||||
|
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
||||||
|
|
||||||
private void octalTextBox_TextChanged(object sender, EventArgs e)
|
compute();
|
||||||
|
spacing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void octalTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//debugLabel.Text = sender.GetType().ToString();
|
//debugLabel.Text = sender.GetType().ToString();
|
||||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||||
|
{
|
||||||
|
// Remove commas from decimalTextBox before parsing it
|
||||||
|
decimalTextBox.Text = decimalTextBox.Text.Replace(",", "");
|
||||||
|
// Remove spacing from binaryTextBox before parsing it
|
||||||
|
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
||||||
|
|
||||||
compute();
|
compute();
|
||||||
|
spacing();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void decimalTextBox_TextChanged(object sender, EventArgs e)
|
private void decimalTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//debugLabel.Text = sender.GetType().ToString();
|
//debugLabel.Text = sender.GetType().ToString();
|
||||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||||
|
{
|
||||||
|
// Remove commas from decimalTextBox before parsing it
|
||||||
|
//decimalTextBox.Text = decimalTextBox.Text.Replace(",", "");
|
||||||
|
// Remove spacing from binaryTextBox before parsing it
|
||||||
|
binaryTextBox.Text = binaryTextBox.Text.Replace(" ", "");
|
||||||
|
|
||||||
compute();
|
compute();
|
||||||
|
Thread.Sleep(250);
|
||||||
|
spacing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void paddingToggle_CheckedChanged(object sender, EventArgs e)
|
private void paddingToggle_CheckedChanged(object sender, EventArgs e)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>+eVmyDX1lwJUsnddCl2hkVC6D4eeY+s8n2S8KLtoftQ=</dsig:DigestValue>
|
<dsig:DigestValue>FLb7o5PmMolOEu475l0smDzDYPLdyAdRY/RzK0kEIiY=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
@ -42,14 +42,14 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="BaseConverter.exe" size="18392">
|
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="BaseConverter.exe" size="18904">
|
||||||
<assemblyIdentity name="BaseConverter" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
|
<assemblyIdentity name="BaseConverter" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
|
||||||
<hash>
|
<hash>
|
||||||
<dsig:Transforms>
|
<dsig:Transforms>
|
||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>TxQfGOwVK3JijOUZcPt71v1L4N47JI7LyWnfoesT0EQ=</dsig:DigestValue>
|
<dsig:DigestValue>RykjKwuxJc8SDlNEdmViyEwnW/WDjfua+galOLDEBps=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>+eVmyDX1lwJUsnddCl2hkVC6D4eeY+s8n2S8KLtoftQ=</dsig:DigestValue>
|
<dsig:DigestValue>FLb7o5PmMolOEu475l0smDzDYPLdyAdRY/RzK0kEIiY=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
@ -42,14 +42,14 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="BaseConverter.exe" size="18392">
|
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="BaseConverter.exe" size="18904">
|
||||||
<assemblyIdentity name="BaseConverter" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
|
<assemblyIdentity name="BaseConverter" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
|
||||||
<hash>
|
<hash>
|
||||||
<dsig:Transforms>
|
<dsig:Transforms>
|
||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>TxQfGOwVK3JijOUZcPt71v1L4N47JI7LyWnfoesT0EQ=</dsig:DigestValue>
|
<dsig:DigestValue>RykjKwuxJc8SDlNEdmViyEwnW/WDjfua+galOLDEBps=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user