예제 #1
0
        public override string GenerateNewLabel()
        {
            string baseLabel = this.Label + "(";

            if (Opl != null)
            {
                baseLabel += Opl.GetDisplayValue() + " in ";
            }

            if (Opr != null)
            {
                baseLabel += Opr.GetDisplayValue();
            }

            baseLabel += ")";

            return(baseLabel);
        }
예제 #2
0
        protected override string GeneratePropertiesLabel()
        {
            bool   isFirstChild = (this.Node == null || this.Node.Attachments.Count == 0 || this.Node.Attachments[0] == this);
            string baseLabel    = string.Empty;

            if (Opl != null)
            {
                baseLabel += Opl.GetDisplayValue() + " ";
            }

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

            if (Opr != null)
            {
                baseLabel += " " + Opr.GetDisplayValue();
            }

            string propertiesLabel = string.Empty;

            if (isFirstChild)
            {
                propertiesLabel = baseLabel;
            }
            else
            {
                fi         = BinaryOperator.GetType().GetField(BinaryOperator.ToString());
                attributes = (Attribute[])fi.GetCustomAttributes(typeof(EnumMemberDescAttribute), false);
                if (attributes.Length > 0)
                {
                    propertiesLabel = ((EnumMemberDescAttribute)attributes[0]).DisplayName + "(" + baseLabel + ")";
                }
            }

            return(propertiesLabel);
        }