Exemplo n.º 1
0
        protected override string GeneratePropertiesLabel()
        {
            string str = string.Empty;

            {
                bool isCompare = this.Operator >= OperatorTypes.Equal && this.Operator <= OperatorTypes.LessEqual;

                if (isCompare)
                {
                    if (_opl != null)
                    {
                        str += _opl.GetDisplayValue();
                    }

                    string opr = "";
                    System.Reflection.FieldInfo fi = this.Operator.GetType().GetField(this.Operator.ToString());
                    Attribute[] attributes         = (Attribute[])fi.GetCustomAttributes(typeof(EnumMemberDescAttribute), false);
                    if (attributes.Length > 0)
                    {
                        opr = ((EnumMemberDescAttribute)attributes[0]).DisplayName;
                    }

                    str += " " + opr + " ";
                    if (_opr2 != null)
                    {
                        str += _opr2.GetDisplayValue();
                    }
                }
            }

            return(str);
        }
Exemplo n.º 2
0
        protected override string GeneratePropertiesLabel()
        {
            string str = string.Empty;

            // action
            if (this.IsAction())
            {
                str = this._opl.Method.GetDisplayValue();
            }

            // assign
            else if (this.IsAssign())
            {
                if (_opl != null)
                {
                    str += _opl.GetDisplayValue();
                }

                str += " = ";

                if (_opr2 != null)
                {
                    str += _opr2.GetDisplayValue();
                }
            }

            // compute or compare
            else
            {
                bool isCompute = this.IsCompute();
                bool isCompare = this.IsCompare();

                if (isCompute || isCompare)
                {
                    if (_opl != null)
                    {
                        str += _opl.GetDisplayValue();
                    }

                    if (isCompute)
                    {
                        str += " = ";

                        if (_opr1 != null)
                        {
                            str += _opr1.GetDisplayValue();
                        }
                    }

                    string opr = "";
                    System.Reflection.FieldInfo fi = this.Operator.GetType().GetField(this.Operator.ToString());
                    Attribute[] attributes         = (Attribute[])fi.GetCustomAttributes(typeof(EnumMemberDescAttribute), false);

                    if (attributes.Length > 0)
                    {
                        opr = ((EnumMemberDescAttribute)attributes[0]).DisplayName;
                    }

                    str += " " + opr + " ";

                    if (_opr2 != null)
                    {
                        str += _opr2.GetDisplayValue();
                    }
                }
            }

            return(str);
        }