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


C# Attributes.DesignerPropertyInfo类代码示例

本文整理汇总了C#中Behaviac.Design.Attributes.DesignerPropertyInfo的典型用法代码示例。如果您正苦于以下问题:C# DesignerPropertyInfo类的具体用法?C# DesignerPropertyInfo怎么用?C# DesignerPropertyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DesignerPropertyInfo类属于Behaviac.Design.Attributes命名空间,在下文中一共展示了DesignerPropertyInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetProperty

        public override void SetProperty(DesignerPropertyInfo property, object obj) {
            base.SetProperty(property, obj);

            _resetMethods = false;

            DesignerMethodEnum enumAtt = property.Attribute as DesignerMethodEnum;

            if (enumAtt != null && property.Property.PropertyType == null)
            { throw new Exception(string.Format(Resources.ExceptionDesignerAttributeExpectedEnum, property.Property.Name)); }

            Nodes.Behavior behavior = GetBehavior();
            _agentType = (behavior != null) ? behavior.AgentType : null;

            SetTypes();

            object action = property.Property.GetValue(obj, null);
            MethodDef method = action as MethodDef;
            int typeIndex = -1;

            if (method != null) {
                typeIndex = getTypeIndex(method.Owner);
            }

            if (typeIndex < 0) {
                typeIndex = 0;
            }

            // Keep only one type for efficiency.
            _currentNames.Clear();
            _currentNames.Add(_names[typeIndex]);

            this.typeComboBox.Items.Clear();
            this.typeComboBox.Items.Add(_types[typeIndex]);
            this.typeComboBox.SelectedIndex = 0;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:35,代码来源:DesignerMethodComboEnumEditor.cs

示例2: SetProperty

        public override void SetProperty(DesignerPropertyInfo property, object obj) {
            base.SetProperty(property, obj);

            string enumName = string.Empty;
            Type enumtype = null;

            DesignerTypeEnum enumAtt = property.Attribute as DesignerTypeEnum;

            if (enumAtt != null) {
                object agentType = property.Property.GetValue(obj, null);
                AgentType t = agentType as AgentType;

                if (t != null)
                { enumName = t.DisplayName; }

                enumtype = property.Property.PropertyType;
            }

            if (enumtype == null)
            { throw new Exception(string.Format(Resources.ExceptionDesignerAttributeExpectedEnum, property.Property.Name)); }

            _agentTypes = getAgentTypes();
            comboBox.Items.Clear();

            foreach(AgentType t in _agentTypes) {
                if (t.DisplayName == enumName) {
                    _agentTypes.Clear();
                    _agentTypes.Add(t);
                    comboBox.Items.Add(t.DisplayName);
                    break;
                }
            }

            comboBox.Text = enumName;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:35,代码来源:DesignerTypeEnumEditor.cs

示例3: ShouldUpdatePropertyGrids

        public override bool ShouldUpdatePropertyGrids(DesignerPropertyInfo property) {
            DesignerPropertyInfo oplProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opl");
            DesignerPropertyInfo operatorProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Operator");

            return property.Property == oplProp.Property ||
                   property.Property == operatorProp.Property;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:7,代码来源:AttachActionUIPolicy.cs

示例4: GetLabel

        public override string GetLabel(DesignerPropertyInfo property) {
            OperatorTypes operatorType = (OperatorTypes)GetProperty(_obj, "Operator");

            // action
            if (this.isAction()) {
                DesignerPropertyInfo oplProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opl");

                if (property.Property == oplProp.Property)
                { return Resources.Method; }
            }

            // assign
            else if (operatorType == OperatorTypes.Assign) {
                DesignerPropertyInfo opr2Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr2");

                if (property.Property == opr2Prop.Property)
                { return Resources.Right; }
            }

            // compute
            else if (operatorType >= OperatorTypes.Add && operatorType <= OperatorTypes.Div) {
            }

            // compare
            else if (operatorType >= OperatorTypes.Equal && operatorType <= OperatorTypes.LessEqual) {
                DesignerPropertyInfo opr2Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr2");

                if (property.Property == opr2Prop.Property)
                { return Resources.Right; }
            }

            return base.GetLabel(property);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:33,代码来源:AttachActionUIPolicy.cs

示例5: ShouldAddProperty

        public override bool ShouldAddProperty(DesignerPropertyInfo property) {
            if (_obj != null) {
                OperatorTypes operatorType = (OperatorTypes)GetProperty(_obj, "Operator");

                DesignerPropertyInfo oplProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opl");
                DesignerPropertyInfo opr1Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr1");
                DesignerPropertyInfo operatorProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Operator");
                DesignerPropertyInfo opr2Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr2");

                // action
                if (this.isAction()) {
                    return property.Property != opr1Prop.Property &&
                           property.Property != operatorProp.Property &&
                           property.Property != opr2Prop.Property;
                }

                // assign
                else if (operatorType == OperatorTypes.Assign) {
                    return property.Property != opr1Prop.Property;
                }

                // compute
                else if (operatorType >= OperatorTypes.Add && operatorType <= OperatorTypes.Div) {
                }

                // compare
                else if (operatorType >= OperatorTypes.Equal && operatorType <= OperatorTypes.LessEqual) {
                    return property.Property != opr1Prop.Property;
                }
            }

            return true;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:33,代码来源:AttachActionUIPolicy.cs

示例6: Update

        public override void Update(object sender, DesignerPropertyInfo property)
        {
            if (_obj != null)
            {
                DesignerPropertyEditor oplEditor = GetEditor(_obj, "Opl");
                Debug.Check(oplEditor != null);
                if (oplEditor == sender)
                {
                    VariableDef opl = (VariableDef)GetProperty(_obj, "Opl");

                    if (opl != null)
                    {
                        RightValueDef opr = (RightValueDef)GetProperty(_obj, "Opr");

                        if (opr != null && opl.ValueType != opr.ValueType)
                        {
                            DesignerPropertyEditor oprEditor = GetEditor(_obj, "Opr");
                            Debug.Check(oprEditor != null);

                            oprEditor.Clear();
                        }
                    }
                }
            }
        }
开发者ID:XyzalZhang,项目名称:behaviac,代码行数:25,代码来源:AssignmentUIPolicy.cs

示例7: SetProperty

        public override void SetProperty(DesignerPropertyInfo property, object obj) {
            base.SetProperty(property, obj);

            DesignerBoolean boolAtt = property.Attribute as DesignerBoolean;

            if (boolAtt != null)
            { checkBox.Checked = (bool)property.Property.GetValue(obj, null); }
        }
开发者ID:675492062,项目名称:behaviac,代码行数:8,代码来源:DesignerBooleanEditor.cs

示例8: SetProperty

        public override void SetProperty(DesignerPropertyInfo property, object obj) {
            base.SetProperty(property, obj);

            object value = property.GetValue(obj);

            if (value != null)
            { setProperty(value, property.Attribute.DisplayName, property.Attribute.HasFlags(DesignerProperty.DesignerFlags.ReadOnly), obj); }

            else
            { update(); }
        }
开发者ID:675492062,项目名称:behaviac,代码行数:11,代码来源:DesignerCompositeEditor.cs

示例9: GetLabel

        public override string GetLabel(DesignerPropertyInfo property)
        {
            OperatorTypes operatorType = (OperatorTypes)GetProperty(_obj, "Operator");

            // compare
            if (operatorType >= OperatorTypes.Equal && operatorType <= OperatorTypes.LessEqual)
            {
                DesignerPropertyInfo opr2Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr2");
                if (property.Property == opr2Prop.Property)
                    return Resources.Right;
            }

            return base.GetLabel(property);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:14,代码来源:TransitionUIPolicy.cs

示例10: ShouldAddProperty

        public override bool ShouldAddProperty(DesignerPropertyInfo property)
        {
            if (_obj != null)
            {
                if (Plugin.IsQueryFiltered)
                {
                    DesignerPropertyInfo domainsProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Domains");
                    DesignerPropertyInfo descriptorRefsProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "DescriptorRefs");

                    return property.Property != domainsProp.Property &&
                        property.Property != descriptorRefsProp.Property;
                }
            }

            return true;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:16,代码来源:BehaviorUIPolicy.cs

示例11: SetProperty

        public override void SetProperty(DesignerPropertyInfo property, object obj) {
            base.SetProperty(property, obj);

            object v = property.Property.GetValue(obj, null);

            if (v != null) {
                if (Plugin.IsCharType(v.GetType())) {
                    textBox.MaxLength = 1;
                }

                textBox.Text = trimQuotes(v.ToString());

            } else {
                Debug.Check(false);
            }
        }
开发者ID:675492062,项目名称:behaviac,代码行数:16,代码来源:DesignerStringEditor.cs

示例12: ShouldAddProperty

        public override bool ShouldAddProperty(DesignerPropertyInfo property)
        {
            if (_obj != null)
            {
                DesignerPropertyInfo binaryOperator = DesignerProperty.GetDesignerProperty(_obj.GetType(), "BinaryOperator");
                if (property.Property == binaryOperator.Property)
                {
                    Attachments.Attachment attach = _obj as Attachments.Attachment;
                    if (attach != null && attach.Node != null && attach.Node.Attachments != null
                        && attach.Node.Attachments.Count > 0 && attach.Node.Attachments[0] == attach)
                    {
                        return false;
                    }
                }
            }

            return base.ShouldAddProperty(property);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:18,代码来源:PreconditionUIPolicy.cs

示例13: SetProperty

        public override void SetProperty(DesignerPropertyInfo property, object obj)
        {
            base.SetProperty(property, obj);

            _resetMethods = false;

            DesignerRightValueEnum enumAttRV = _property.Attribute as DesignerRightValueEnum;

            this.FilterType = null;
            if (enumAttRV != null && enumAttRV.DependedProperty != "")
            {
                Type objType = _object.GetType();
                PropertyInfo pi = objType.GetProperty(enumAttRV.DependedProperty);
                object propMember = pi.GetValue(_object, null);
                VariableDef var = propMember as VariableDef;
                if (var != null)
                {
                    this.FilterType = var.GetValueType();
                }
                else
                {
                    MethodDef method = propMember as MethodDef;
                    if (method != null)
                    {
                        this.FilterType = method.ReturnType;
                    }
                    else
                    {
                        RightValueDef varRVp = propMember as RightValueDef;
                        if (varRVp != null)
                        {
                            this.FilterType = varRVp.ValueType;
                        }
                    }
                }
            }
            else
            {
                this.FilterType = _property.Attribute.FilterType;
            }

            setComboBox();
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:43,代码来源:DesignerMethodEnumEditor.cs

示例14: Update

        public override void Update(object sender, DesignerPropertyInfo property)
        {
            if (_obj != null)
            {
                DesignerPropertyEditor statusPhaseEditor = GetEditor(_obj, "TransitionPhase");
                Debug.Check(statusPhaseEditor != null);

                PluginBehaviac.Events.AlwaysTransition at = this._obj as PluginBehaviac.Events.AlwaysTransition;
                if (at.Node is PluginBehaviac.Nodes.FSMReferencedBehavior)
                {
                    //
                }
                else
                {
                    statusPhaseEditor.Enabled = false;

                    //ResultOption is set to be SUCCESS by default
                    SetProperty(_obj, "TransitionPhase", PluginBehaviac.Events.ETransitionPhase.ETP_Always);
                }
            }
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:21,代码来源:AlwaysTransitionUIPolicy.cs

示例15: ShouldAddProperty

        public override bool ShouldAddProperty(DesignerPropertyInfo property)
        {
            if (_obj != null)
            {
                OperatorTypes operatorType = (OperatorTypes)GetProperty(_obj, "Operator");
                DesignerPropertyInfo opr1Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr1");


                DesignerPropertyInfo oplProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opl");
                DesignerPropertyInfo operatorProp = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Operator");
                DesignerPropertyInfo opr2Prop = DesignerProperty.GetDesignerProperty(_obj.GetType(), "Opr2");

                // compare
                if (operatorType >= OperatorTypes.Equal && operatorType <= OperatorTypes.LessEqual)
                {
                    return property.Property != opr1Prop.Property;
                }
            }

            return true;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:21,代码来源:TransitionUIPolicy.cs


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