当前位置: 首页>>代码示例>>C#>>正文


C# AgentType.GetProperties方法代码示例

本文整理汇总了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;
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:21,代码来源:DesignerPropertyEnum.cs

示例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;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:32,代码来源:DesignerPropertyEnum.cs

示例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;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:37,代码来源:DesignerMethodEnum.cs

示例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;
        }
开发者ID:godsonhand,项目名称:behaviac,代码行数:19,代码来源:DesignerMethodEnum.cs


注:本文中的AgentType.GetProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。