|
@@ -682,13 +682,12 @@ namespace OTSPartA_STDEditor
|
|
|
|
|
|
private void textbox_STDEditor_MouseLeave(object sender, EventArgs e)
|
|
|
{
|
|
|
- dataGridView_KeyElements.Rows.Clear();
|
|
|
- dataGridView_KeyElements.Columns.Clear();
|
|
|
+ dataGridView_SubElements.Rows.Clear();
|
|
|
+ dataGridView_SubElements.Columns.Clear();
|
|
|
|
|
|
|
|
|
string str_RemoveBlank = textbox_STDEditor.Text.ToString().Replace(" ", "");
|
|
|
str_RemoveBlank = str_RemoveBlank.Replace("\r\n", "");
|
|
|
- //str_RemoveBlank = str_RemoveBlank.Replace("fourth_elem", "");
|
|
|
string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
|
|
|
List<string> str_Removeandor = new List<string>();
|
|
|
for (int i = 0; i < str_Removeand.Length; i++)
|
|
@@ -712,46 +711,46 @@ namespace OTSPartA_STDEditor
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<string> SubElements = new List<string>();
|
|
|
- for (int i = 0; i < dataGridView_SubElements.ColumnCount; i++)
|
|
|
+ List<string> KeyElements = new List<string>();
|
|
|
+ for (int i = 0; i < dataGridView_KeyElements.ColumnCount; i++)
|
|
|
{
|
|
|
- if (UsingElementL.Contains(dataGridView_SubElements.Rows[0].Cells[i].Value))
|
|
|
+ if (UsingElementL.Contains(dataGridView_KeyElements.Rows[0].Cells[i].Value))
|
|
|
{
|
|
|
- SubElements.Add(dataGridView_SubElements.Rows[0].Cells[i].Value.ToString());
|
|
|
+ KeyElements.Add(dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- dataGridView_SubElements.Rows.Clear();
|
|
|
- dataGridView_SubElements.Columns.Clear();
|
|
|
+ dataGridView_KeyElements.Rows.Clear();
|
|
|
+ dataGridView_KeyElements.Columns.Clear();
|
|
|
|
|
|
- for (int i = 0; i < SubElements.Count; i++)
|
|
|
+ for (int i = 0; i < KeyElements.Count; i++)
|
|
|
{
|
|
|
DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
|
|
|
- dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
|
|
|
- dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
- if (dataGridView_SubElements.Rows.Count == 0)
|
|
|
+ dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
|
|
|
+ dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
+ if (dataGridView_KeyElements.Rows.Count == 0)
|
|
|
{
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
- dataGridView_SubElements.Rows.Add(row);
|
|
|
+ dataGridView_KeyElements.Rows.Add(row);
|
|
|
}
|
|
|
- dataGridView_SubElements.Rows[0].Cells[dataGridView_SubElements.ColumnCount - 1].Value = SubElements[i];
|
|
|
+ dataGridView_KeyElements.Rows[0].Cells[dataGridView_KeyElements.ColumnCount - 1].Value = KeyElements[i];
|
|
|
}
|
|
|
|
|
|
- if (SubElements.Count > 0)
|
|
|
+ if (KeyElements.Count > 0)
|
|
|
{
|
|
|
for (int i = 0; i < UsingElementL.Count; i++)
|
|
|
{
|
|
|
- if (!SubElements.Contains(UsingElementL[i]))
|
|
|
+ if (!KeyElements.Contains(UsingElementL[i]))
|
|
|
{
|
|
|
DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
|
|
|
- dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
|
|
|
- dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
- if (dataGridView_KeyElements.Rows.Count == 0)
|
|
|
+ dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
|
|
|
+ dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
+ if (dataGridView_SubElements.Rows.Count == 0)
|
|
|
{
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
- dataGridView_KeyElements.Rows.Add(row);
|
|
|
+ dataGridView_SubElements.Rows.Add(row);
|
|
|
}
|
|
|
- dataGridView_KeyElements.Rows[0].Cells[dataGridView_KeyElements.ColumnCount - 1].Value = UsingElementL[i];
|
|
|
+ dataGridView_SubElements.Rows[0].Cells[dataGridView_SubElements.ColumnCount - 1].Value = UsingElementL[i];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -760,14 +759,14 @@ namespace OTSPartA_STDEditor
|
|
|
for (int i = 0; i < UsingElementL.Count; i++)
|
|
|
{
|
|
|
DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
|
|
|
- dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
|
|
|
- dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
- if (dataGridView_KeyElements.Rows.Count == 0)
|
|
|
+ dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
|
|
|
+ dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
+ if (dataGridView_SubElements.Rows.Count == 0)
|
|
|
{
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
- dataGridView_KeyElements.Rows.Add(row);
|
|
|
+ dataGridView_SubElements.Rows.Add(row);
|
|
|
}
|
|
|
- dataGridView_KeyElements.Rows[0].Cells[i].Value = UsingElementL[i];
|
|
|
+ dataGridView_SubElements.Rows[0].Cells[i].Value = UsingElementL[i];
|
|
|
}
|
|
|
}
|
|
|
dataGridView_KeyElements.ClearSelection();
|