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.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
@ -37,25 +38,27 @@ namespace WindowsFormsApplication1
|
||||
toolTip.SetToolTip(autoCompute, "Automatically computes input based on changes made to textbox contents.");
|
||||
|
||||
}
|
||||
|
||||
private void compute()
|
||||
int paddingOffset = 0, spacingOffset = 0, i = 0;
|
||||
public void compute()
|
||||
{
|
||||
// Define variables
|
||||
long decimalNum = 0, hexNum = 0, binNum = 0, octalNum = 0;
|
||||
int paddingOffset = 0,spacingOffset = 0, i = 0;
|
||||
//int paddingOffset = 0,spacingOffset = 0, i = 0;
|
||||
|
||||
try
|
||||
{ // Extract data from text boxes.
|
||||
|
||||
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);
|
||||
|
||||
hexNum = Convert.ToInt64(hexTextBox.Text, 16);
|
||||
octalNum = Convert.ToInt64(octalTextBox.Text, 8);
|
||||
paddingOffset = int.Parse(paddingOffsetTextBox.Text);
|
||||
spacingOffset = int.Parse(spacingOffsetTextBox.Text);
|
||||
|
||||
}
|
||||
catch (Exception Ex)
|
||||
catch
|
||||
{
|
||||
clearTextboxes();
|
||||
MessageBox.Show("Invalid number entered into one of the textboxes!");
|
||||
@ -120,9 +123,17 @@ namespace WindowsFormsApplication1
|
||||
{
|
||||
binaryTextBox.Text = Convert.ToString(binNum, 2);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (spacingToggle.Checked)
|
||||
|
||||
hexTextBox.Text = hexNum.ToString("X");
|
||||
octalTextBox.Text = Convert.ToString(octalNum, 8);
|
||||
decimalTextBox.Text = decimalNum.ToString();
|
||||
}
|
||||
public void spacing()
|
||||
{
|
||||
spacingOffset = int.Parse(spacingOffsetTextBox.Text);
|
||||
try
|
||||
{
|
||||
if (spacingToggle.Checked)
|
||||
{
|
||||
string binaryString = binaryTextBox.Text; // Define string to offset
|
||||
int binarySize = binaryString.Length; //count the length of the string.
|
||||
@ -144,15 +155,14 @@ namespace WindowsFormsApplication1
|
||||
}
|
||||
}
|
||||
binaryTextBox.Text = builder.ToString();
|
||||
builder = null; // null out builder when done
|
||||
//builder = null; // null out builder when done
|
||||
//binaryTextBox.Text = binaryString;
|
||||
}
|
||||
} catch (Exception Ex) {
|
||||
}
|
||||
catch
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -185,8 +195,13 @@ namespace WindowsFormsApplication1
|
||||
}
|
||||
|
||||
private void computeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
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(" ", "");
|
||||
compute();
|
||||
spacing();
|
||||
}
|
||||
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
@ -233,29 +248,62 @@ namespace WindowsFormsApplication1
|
||||
private void binaryTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//debugLabel.Text = sender.GetType().ToString();
|
||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||
compute();
|
||||
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();
|
||||
//spacing();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void hexTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//debugLabel.Text = sender.GetType().ToString();
|
||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||
compute();
|
||||
}
|
||||
|
||||
private void octalTextBox_TextChanged(object sender, EventArgs e)
|
||||
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();
|
||||
spacing();
|
||||
}
|
||||
}
|
||||
private void octalTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//debugLabel.Text = sender.GetType().ToString();
|
||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||
compute();
|
||||
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();
|
||||
spacing();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void decimalTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//debugLabel.Text = sender.GetType().ToString();
|
||||
if (autoCompute.Checked & (sender.GetType().ToString().Equals("System.Windows.Forms.TextBox")))
|
||||
compute();
|
||||
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();
|
||||
Thread.Sleep(250);
|
||||
spacing();
|
||||
}
|
||||
}
|
||||
|
||||
private void paddingToggle_CheckedChanged(object sender, EventArgs e)
|
||||
|
@ -14,7 +14,7 @@
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>+eVmyDX1lwJUsnddCl2hkVC6D4eeY+s8n2S8KLtoftQ=</dsig:DigestValue>
|
||||
<dsig:DigestValue>FLb7o5PmMolOEu475l0smDzDYPLdyAdRY/RzK0kEIiY=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
Binary file not shown.
@ -42,14 +42,14 @@
|
||||
</dependentAssembly>
|
||||
</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" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>TxQfGOwVK3JijOUZcPt71v1L4N47JI7LyWnfoesT0EQ=</dsig:DigestValue>
|
||||
<dsig:DigestValue>RykjKwuxJc8SDlNEdmViyEwnW/WDjfua+galOLDEBps=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>+eVmyDX1lwJUsnddCl2hkVC6D4eeY+s8n2S8KLtoftQ=</dsig:DigestValue>
|
||||
<dsig:DigestValue>FLb7o5PmMolOEu475l0smDzDYPLdyAdRY/RzK0kEIiY=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
Binary file not shown.
@ -42,14 +42,14 @@
|
||||
</dependentAssembly>
|
||||
</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" />
|
||||
<hash>
|
||||
<dsig:Transforms>
|
||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||
</dsig:Transforms>
|
||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||
<dsig:DigestValue>TxQfGOwVK3JijOUZcPt71v1L4N47JI7LyWnfoesT0EQ=</dsig:DigestValue>
|
||||
<dsig:DigestValue>RykjKwuxJc8SDlNEdmViyEwnW/WDjfua+galOLDEBps=</dsig:DigestValue>
|
||||
</hash>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user