сдано
This commit is contained in:
parent
37673c4961
commit
5d21dc1cde
2
KOP_Labs/KOP_Labs/CustomComboBox.Designer.cs
generated
2
KOP_Labs/KOP_Labs/CustomComboBox.Designer.cs
generated
@ -38,7 +38,7 @@
|
||||
textBox.Size = new Size(263, 27);
|
||||
textBox.TabIndex = 0;
|
||||
textBox.TextChanged += textBox_TextChanged;
|
||||
textBox.Enter += textBox_Enter;
|
||||
//textBox.Enter += textBox_Enter;
|
||||
//
|
||||
// CustomComboBox
|
||||
//
|
||||
|
@ -16,7 +16,8 @@ namespace KOP_Labs
|
||||
public CustomComboBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
public int? MinValue { get; set; }
|
||||
public int? MaxValue { get; set; }
|
||||
|
||||
@ -45,7 +46,7 @@ namespace KOP_Labs
|
||||
}
|
||||
else
|
||||
{
|
||||
textBox.ForeColor = Color.Black;
|
||||
textBox.ForeColor = Color.Green;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,11 @@ namespace KOP_Labs
|
||||
|
||||
public void AddObjectToTree<T>(T obj)
|
||||
{
|
||||
if (hierarchy == null)
|
||||
{
|
||||
throw new HierarcyNullException("Иерархия не задана");
|
||||
}
|
||||
TreeNode currentNode = treeView.Nodes.Count > 0 ? treeView.Nodes[0] : treeView.Nodes.Add("");
|
||||
|
||||
foreach (var property in hierarchy)
|
||||
{
|
||||
var value = obj.GetType().GetProperty(property).GetValue(obj, null).ToString();
|
||||
@ -63,6 +66,10 @@ namespace KOP_Labs
|
||||
|
||||
public T GetSelectedObject<T>() where T : new()
|
||||
{
|
||||
if (hierarchy == null)
|
||||
{
|
||||
throw new HierarcyNullException("Иерархия не задана");
|
||||
}
|
||||
if (treeView.SelectedNode == null)
|
||||
{
|
||||
throw new InvalidOperationException("Узел не выбран");
|
||||
|
4
KOP_Labs/WinFormForTest/Form1.Designer.cs
generated
4
KOP_Labs/WinFormForTest/Form1.Designer.cs
generated
@ -42,8 +42,8 @@
|
||||
// customComboBox1
|
||||
//
|
||||
customComboBox1.Location = new Point(264, 50);
|
||||
customComboBox1.Max = 20;
|
||||
customComboBox1.Min = 5;
|
||||
customComboBox1.MaxValue = 20;
|
||||
customComboBox1.MinValue = 5;
|
||||
customComboBox1.Name = "customComboBox1";
|
||||
customComboBox1.Size = new Size(301, 125);
|
||||
customComboBox1.TabIndex = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user