Ejemplo n.º 1
0
        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();
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public override void Update(object sender, DesignerPropertyInfo property)
        {
            if (_obj != null)
            {
                DesignerPropertyEditor resultOptionEditor  = GetEditor(_obj, "ResultOption");
                DesignerPropertyEditor resultFunctorEditor = GetEditor(_obj, "ResultFunctor");
                Debug.Check(resultOptionEditor != null && resultFunctorEditor != null);
                if (resultOptionEditor != null && resultFunctorEditor != null)
                {
                    MethodDef method      = GetProperty(_obj, "Method") as MethodDef;
                    MethodDef checkMethod = GetProperty(_obj, "ResultFunctor") as MethodDef;

                    if (method == null || method.NativeReturnType == "behaviac::EBTStatus")
                    {
                        resultOptionEditor.Enabled  = false;
                        resultFunctorEditor.Enabled = false;

                        //ResultOption is set to be SUCCESS by default
                        SetProperty(_obj, "ResultOption", EBTStatus.BT_INVALID);
                    }
                    else
                    {
                        bool   enableMethod = true;
                        object prop         = GetProperty(_obj, "ResultOption");

                        if (prop is EBTStatus)
                        {
                            EBTStatus checkStatusdProp = (EBTStatus)prop;

                            if (EBTStatus.BT_INVALID != checkStatusdProp)
                            {
                                enableMethod = false;
                            }
                        }

                        resultOptionEditor.Enabled  = true;
                        resultFunctorEditor.Enabled = enableMethod;
                    }

                    if (!resultFunctorEditor.Enabled)
                    {
                        SetProperty(_obj, "ResultFunctor", null);
                        resultFunctorEditor.Clear();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        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)
                        {
                            if (opl.ValueType != opr.ValueType)
                            {
                                DesignerPropertyEditor oprEditor = GetEditor(_obj, "Opr");
                                Debug.Check(oprEditor != null);
                                if (oprEditor != null)
                                {
                                    oprEditor.Clear();
                                }
                            }
                        }
                    }
                }
                else
                {
                    DesignerPropertyEditor oplEditorCast = GetEditor(_obj, "CastRight");
                    Debug.Check(oplEditorCast != null);

                    if (oplEditorCast == sender)
                    {
                        PluginBehaviac.Nodes.Assignment assignNode = _obj as PluginBehaviac.Nodes.Assignment;

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

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

                                // oprEditor.ValueType might be overwritten in SetupCastSettings if casting
                                // so that here to backup it first so that it can be restored later if not casting
                                if (assignNode.IsCasting)
                                {
                                    _valueTypesBackup = oprEditor.ValueType;
                                }
                                else
                                {
                                    oprEditor.ValueType = _valueTypesBackup;
                                }

                                oprEditor.Clear();
                                oprEditor.FilterType = null;
                            }
                        }
                    }
                }
            }
        }