-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAddNumbersDefinition.cs
More file actions
113 lines (100 loc) · 3.02 KB
/
Copy pathAddNumbersDefinition.cs
File metadata and controls
113 lines (100 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Copyright (c) 2004-2008 Userwise Solutions LLC. All rights reserved.
using System;
using System.ComponentModel;
using System.Text;
namespace NetCams
{
class AddNumbersDefinition : NetCams.ToolDefinition
{
public AddNumbersDefinition(TestSequence testSequence)
: base(testSequence)
{
//
// TODO: Add constructor logic here
//
mResult = new GeneratedValueDefinition(testSequence, OwnerLink.newLink(this, "Result"));
mResult.Type = DataType.IntegerNumber;
mResult.AddDependency(this);
mResult.Name = "ColorMatchCountResult";
}
public override void CreateInstance(TestExecution theExecution)
{
new AddNumbersInstance(this, theExecution);
}
public override bool IsDependentOn(IObjectDefinition theOtherObject)
{
if (theOtherObject == this) return true;
if (mValue1 != null && mValue1.IsDependentOn(theOtherObject)) return true;
if (mValue2 != null && mValue2.IsDependentOn(theOtherObject)) return true;
return base.IsDependentOn(theOtherObject);
}
public override int ToolMapRow
{
get
{
int result = base.ToolMapRow - 1;
if (mValue1 != null)
{
result = Math.Max(result, mValue1.ToolMapRow);
}
if (mValue2 != null)
{
result = Math.Max(result, mValue2.ToolMapRow);
}
return result + 1;
}
}
private DataValueDefinition mValue1 = null;
[CategoryAttribute("Input")]
public DataValueDefinition Value1
{
get { return mValue1; }
set
{
HandlePropertyChange(this, "Value1", mValue1, value);
mValue1 = value;
}
}
/* public string Value1
{
get
{
if (mValue1 == null) return "";
return mValue1.Name;
}
set
{
mValue1 = Sequence().GetNumberObject(value);
}
}*/
private DataValueDefinition mValue2 = null;
[CategoryAttribute("Input")]
public DataValueDefinition Value2
{
get { return mValue2; }
set
{
HandlePropertyChange(this, "Value2", mValue2, value);
mValue2 = value;
}
}
/* public string Value2
{
get
{
if (mValue2 == null) return "";
return mValue2.Name;
}
set
{
mValue2 = Sequence().GetNumberObject(value);
}
}*/
private GeneratedValueDefinition mResult = null;
[CategoryAttribute("Output")]
public GeneratedValueDefinition Result
{
get { return mResult; }
}
}
}