Reordered methods within MainForm
This commit is contained in:
@@ -83,9 +83,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Controls\BinLayoutView.cs">
|
<Compile Include="Controls\BinLayoutView.cs" />
|
||||||
<SubType>Component</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Forms\DataGridViewExtensions.cs" />
|
<Compile Include="Forms\DataGridViewExtensions.cs" />
|
||||||
<Compile Include="Forms\MainForm.cs">
|
<Compile Include="Forms\MainForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
@@ -93,9 +91,7 @@
|
|||||||
<Compile Include="Forms\MainForm.Designer.cs">
|
<Compile Include="Forms\MainForm.Designer.cs">
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Forms\ResultsForm.cs">
|
<Compile Include="Forms\ResultsForm.cs" />
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Forms\ResultsForm.Designer.cs">
|
<Compile Include="Forms\ResultsForm.Designer.cs">
|
||||||
<DependentUpon>ResultsForm.cs</DependentUpon>
|
<DependentUpon>ResultsForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@@ -56,22 +56,6 @@ namespace CutList.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BinInputItemBindingSource_ListChanged(object sender, ListChangedEventArgs e)
|
|
||||||
{
|
|
||||||
UpdateRunButtonState();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ItemBindingSource_ListChanged(object sender, ListChangedEventArgs e)
|
|
||||||
{
|
|
||||||
UpdateRunButtonState();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnLoad(EventArgs e)
|
|
||||||
{
|
|
||||||
base.OnLoad(e);
|
|
||||||
UpdateRunButtonState();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateRunButtonState()
|
private void UpdateRunButtonState()
|
||||||
{
|
{
|
||||||
var isValid = IsValid();
|
var isValid = IsValid();
|
||||||
@@ -160,6 +144,19 @@ namespace CutList.Forms
|
|||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string ToolsFilePath
|
||||||
|
{
|
||||||
|
get { return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data\\Tools.json"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Tool> GetTools()
|
||||||
|
{
|
||||||
|
var json = File.ReadAllText(ToolsFilePath);
|
||||||
|
var list = JsonConvert.DeserializeObject<List<Tool>>(json);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
private List<BinItem> GetItems()
|
private List<BinItem> GetItems()
|
||||||
{
|
{
|
||||||
var items2 = new List<BinItem>();
|
var items2 = new List<BinItem>();
|
||||||
@@ -187,6 +184,18 @@ namespace CutList.Forms
|
|||||||
return comboBox1.SelectedItem as Tool;
|
return comboBox1.SelectedItem as Tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SaveTools(IEnumerable<Tool> tools)
|
||||||
|
{
|
||||||
|
var json = JsonConvert.SerializeObject(tools, Formatting.Indented);
|
||||||
|
File.WriteAllText(ToolsFilePath, json);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLoad(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoad(e);
|
||||||
|
UpdateRunButtonState();
|
||||||
|
}
|
||||||
|
|
||||||
private void toolStripButton1_Click(object sender, EventArgs e)
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Open();
|
Open();
|
||||||
@@ -202,25 +211,6 @@ namespace CutList.Forms
|
|||||||
Run();
|
Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ToolsFilePath
|
|
||||||
{
|
|
||||||
get { return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data\\Tools.json"); }
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Tool> GetTools()
|
|
||||||
{
|
|
||||||
var json = File.ReadAllText(ToolsFilePath);
|
|
||||||
var list = JsonConvert.DeserializeObject<List<Tool>>(json);
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SaveTools(IEnumerable<Tool> tools)
|
|
||||||
{
|
|
||||||
var json = JsonConvert.SerializeObject(tools, Formatting.Indented);
|
|
||||||
File.WriteAllText(ToolsFilePath, json);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var tool = comboBox1.SelectedItem as Tool;
|
var tool = comboBox1.SelectedItem as Tool;
|
||||||
@@ -288,5 +278,15 @@ namespace CutList.Forms
|
|||||||
if (e.ColumnIndex == lengthInputValueDataGridViewTextBoxColumn.Index)
|
if (e.ColumnIndex == lengthInputValueDataGridViewTextBoxColumn.Index)
|
||||||
dataGridView2.Refresh();
|
dataGridView2.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BinInputItemBindingSource_ListChanged(object sender, ListChangedEventArgs e)
|
||||||
|
{
|
||||||
|
UpdateRunButtonState();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ItemBindingSource_ListChanged(object sender, ListChangedEventArgs e)
|
||||||
|
{
|
||||||
|
UpdateRunButtonState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user