Example #1
0
        public override object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            //List<object> excludedOperatorsResult = new List<object>() { OperatorType.Assignment, OperatorType.In };
            List <object> excludedOperatorsResult = new List <object>();

            if (enumAttr != null && enumAttr.ExcludeTag == "Opl")
            {
                if (this.Opl != null)
                {
                    bool bNoAssignment = (this.Opl.Method != null);
                    if (this.Opl.ValueType != typeof(bool))
                    {
                        //and and or are only valid for bool, so to exclude and and or when the type is not bool
                        object[] excludedOperators = new object[] { OperatorType.And, OperatorType.Or };
                        excludedOperatorsResult.AddRange(excludedOperators);
                    }
                    else if (this.Opl.ValueType == typeof(bool))
                    {
                        object[] excludedOperators = new object[] { OperatorType.Greater, OperatorType.GreaterEqual, OperatorType.Less, OperatorType.LessEqual };
                        excludedOperatorsResult.AddRange(excludedOperators);
                    }

                    if (bNoAssignment)
                    {
                        excludedOperatorsResult.Add(OperatorType.Assignment);
                    }
                }
            }

            return(excludedOperatorsResult.ToArray());
        }
Example #2
0
        public override object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            if (enumAttr != null && enumAttr.ExcludeTag == "PreconditionFailResult")
            {
                //only success/failture are valid
                object[] status = new object[] { EBTStatus.BT_INVALID, EBTStatus.BT_RUNNING };

                return(status);
            }

            return(null);
        }
Example #3
0
        public object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            ArrayList enums = new ArrayList();

            enums.Add(OperatorTypes.Invalid);
            enums.Add(OperatorTypes.Equal);
            enums.Add(OperatorTypes.NotEqual);
            enums.Add(OperatorTypes.Greater);
            enums.Add(OperatorTypes.Less);
            enums.Add(OperatorTypes.GreaterEqual);
            enums.Add(OperatorTypes.LessEqual);

            if (enumAttr != null && enumAttr.ExcludeTag == "EffectorOperaptor")
            {
                if (this.Opl != null && !string.IsNullOrEmpty(this.Opl.NativeType))
                {
                    bool bIsBool   = false;
                    bool bIsNumber = false;

                    Type type = Plugin.GetTypeFromName(Plugin.GetNativeTypeName(this.Opl.NativeType));

                    if (type != null)
                    {
                        bIsBool   = Plugin.IsBooleanType(type);
                        bIsNumber = (Plugin.IsIntergerType(type) || Plugin.IsFloatType(type));
                    }

                    if (bIsBool || !bIsNumber)
                    {
                        enums.Add(OperatorTypes.Add);
                        enums.Add(OperatorTypes.Sub);
                        enums.Add(OperatorTypes.Mul);
                        enums.Add(OperatorTypes.Div);
                    }

                    if (this.Opl.IsMethod && this.Opl.Method != null)
                    {
                        enums.Add(OperatorTypes.Assign);

                        if (!enums.Contains(OperatorTypes.Add))
                        {
                            enums.Add(OperatorTypes.Add);
                            enums.Add(OperatorTypes.Sub);
                            enums.Add(OperatorTypes.Mul);
                            enums.Add(OperatorTypes.Div);
                        }
                    }
                }
            }

            return(enums.ToArray());
        }
Example #4
0
        public override object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            object[] excludedEnums = base.GetExcludedEnums(enumAttr);

            Debug.Check(excludedEnums.Length >= 1 && (OperatorTypes)excludedEnums[0] == OperatorTypes.Invalid);

            ArrayList            enums        = new ArrayList(excludedEnums);
            List <OperatorTypes> compareEnums = new List <OperatorTypes> {
                OperatorTypes.Equal, OperatorTypes.Greater, OperatorTypes.Less, OperatorTypes.GreaterEqual, OperatorTypes.LessEqual, OperatorTypes.NotEqual
            };

            foreach (object e in compareEnums)
            {
                if (!enums.Contains(e))
                {
                    enums.Add(e);
                }
            }

            return(enums.ToArray());
        }
Example #5
0
        public override object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            if (enumAttr != null && enumAttr.ExcludeTag == "ComputeOperaptor")
            {
                if (this.Opl != null)
                {
                    if (string.IsNullOrEmpty(this.Opl.NativeType))
                    {
                        return(null);
                    }

                    bool bIsBool   = false;
                    bool bIsNumber = false;

                    Type type = this.Opl.ValueType;

                    if (type != null)
                    {
                        bIsBool   = Plugin.IsBooleanType(type);
                        bIsNumber = (Plugin.IsIntergerType(type) || Plugin.IsFloatType(type));
                    }

                    if (bIsBool || !bIsNumber)
                    {
                        //+/-/*// are not valid for bool
                        object[] excludedOperators = new object[] { ComputeOperator.Add, ComputeOperator.Sub, ComputeOperator.Mul, ComputeOperator.Div };

                        return(excludedOperators);
                    }
                    else
                    {
                        //object[] excludedOperators = new object[] { ComputeOperator.Invalid };

                        //return excludedOperators;
                    }
                }
            }

            return(null);
        }
Example #6
0
        public override object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            if (enumAttr != null && enumAttr.DisplayName == "Operator")
            {
                if (this.Opl != null)
                {
                    if (this.Opl.ValueType != typeof(bool))
                    {
                        //and and or are only valid for bool, so to exclude and and or when the type is not bool
                        object[] excludedOperators = new object[] { OperatorType.And, OperatorType.Or };

                        return(excludedOperators);
                    }
                    else if (this.Opl.ValueType == typeof(bool))
                    {
                        object[] excludedOperators = new object[] { OperatorType.Greater, OperatorType.GreaterEqual, OperatorType.Less, OperatorType.LessEqual };

                        return(excludedOperators);
                    }
                }
            }

            return(null);
        }
Example #7
0
 public override object[] GetExcludedEnums(DesignerEnum enumAttr)
 {
     return(null);
 }
Example #8
0
 public virtual object[] GetExcludedEnums(DesignerEnum enumAttr)
 {
     return(null);
 }
Example #9
0
        public override object[] GetExcludedEnums(DesignerEnum enumAttr)
        {
            object[] status = new object[] { EBTStatus.BT_INVALID, EBTStatus.BT_RUNNING, XMLPluginBehaviac.behaviac_EBTStatus.BT_INVALID, XMLPluginBehaviac.behaviac_EBTStatus.BT_RUNNING };

            return(status);
        }