本文整理汇总了C#中AgentType.GetProperties方法的典型用法代码示例。如果您正苦于以下问题:C# AgentType.GetProperties方法的具体用法?C# AgentType.GetProperties怎么用?C# AgentType.GetProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AgentType
的用法示例。
在下文中一共展示了AgentType.GetProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setProperty
protected VariableDef setProperty(AgentType agentType, string propertyName, string valueType)
{
if (agentType != null)
{
IList<PropertyDef> properties = agentType.GetProperties();
foreach (PropertyDef p in properties)
{
if (p.Name == propertyName
#if BEHAVIAC_NAMESPACE_FIX
|| p.Name.EndsWith(propertyName)
#endif
)
{
VariableDef v = new VariableDef(p, valueType);
return v;
}
}
}
return null;
}
示例2: setProperty
protected static VariableDef setProperty(List<Nodes.Node.ErrorCheck> result, DefaultObject node, AgentType agentType, string propertyName, string arrayIndexStr, string valueType)
{
if (agentType != null)
{
IList<PropertyDef> properties = agentType.GetProperties();
foreach (PropertyDef p in properties)
{
if (p.Name == propertyName
#if BEHAVIAC_NAMESPACE_FIX
|| p.Name.EndsWith(propertyName)
#endif
)
{
PropertyDef prop = p.Clone();
prop.Owner = valueType;
VariableDef v = new VariableDef(prop, valueType);
if (v != null && !string.IsNullOrEmpty(arrayIndexStr))
{
v.ArrayIndexElement = new MethodDef.Param("ArrayIndex", typeof(int), "int", "ArrayIndex", "ArrayIndex");
v.ArrayIndexElement.IsArrayIndex = true;
DesignerMethodEnum.parseParam(result, node, null, v.ArrayIndexElement, arrayIndexStr);
}
return v;
}
}
}
return null;
}
示例3: createVariable
private static VariableDef createVariable(List<Nodes.Node.ErrorCheck> result, DefaultObject node, AgentType agentType, string instacneName, string propertyName)
{
List<string> tokens = DesignerPropertyEnum.SplitTokens(propertyName);
Debug.Check(tokens.Count > 0);
string arrayIndexStr = null;
if (tokens.Count > 1) {
propertyName = tokens[0] + "[]";
arrayIndexStr = tokens[1];
}
Nodes.Behavior behavior = node.Behavior as Nodes.Behavior;
agentType = Plugin.GetInstanceAgentType(instacneName, behavior, agentType);
if (agentType != null) {
IList<PropertyDef> properties = agentType.GetProperties();
foreach(PropertyDef p in properties) {
if (p.Name == propertyName
#if BEHAVIAC_NAMESPACE_FIX
|| p.Name.EndsWith(propertyName)
#endif
) {
VariableDef v = new VariableDef(p, instacneName);
if (v != null && !string.IsNullOrEmpty(arrayIndexStr)) {
v.ArrayIndexElement = new MethodDef.Param("ArrayIndex", typeof(int), "int", "ArrayIndex", "ArrayIndex");
v.ArrayIndexElement.IsArrayIndex = true;
DesignerMethodEnum.parseParam(result, node, null, v.ArrayIndexElement, arrayIndexStr);
}
return v;
}
}
}
return null;
}
示例4: createVariable
private static VariableDef createVariable(AgentType agentType, string instacneName, string propertyName)
{
agentType = Plugin.GetInstanceAgentType(instacneName, agentType);
if (agentType != null)
{
IList<PropertyDef> properties = agentType.GetProperties();
foreach (PropertyDef p in properties)
{
if (p.Name == propertyName
#if BEHAVIAC_NAMESPACE_FIX
|| p.Name.EndsWith(propertyName)
#endif
)
return new VariableDef(p, instacneName);
}
}
return null;
}