KSPDev Client utilities
KSPDev Client utilities
KSPDev.ProcessingUtils
Preconditions Class
Preconditions Methods
ConfValueExists Method
HasSize Method
MakeContextError Method
MinElements Method
NotNull Method
NotNullOrEmpty Method
OneOf(T) Method
Preconditions
HasSize Method
Throws if collection has not the expected number of elements.
Namespace:
KSPDev.ProcessingUtils
Assembly:
KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntax
C#
Copy
public
static
void
HasSize
(
IList
arg
,
int
size
,
string
message
=
null
,
Object
context
=
null
)
Request Example
View Source
Parameters
arg
Type:
System.Collections
IList
The value to check.
size
Type:
System
Int32
The expected collection size.
message
(Optional)
Type:
System
String
An optional message to present in the error.
context
(Optional)
Type:
System
Object
The optional "owner" object.
Exceptions
Exception
Condition
InvalidOperationException
If condition fails.
See Also
Reference
Preconditions Class
KSPDev.ProcessingUtils Namespace
Send comments on this topic to
igor.zavoychinskiy@gmail.com