Exemplo n.º 1
0
        public static string GetDescription(ArithOperator enum_0)
        {
            if (enum_0 == 0)
            {
                throw new ArgumentNullException("value");
            }
            string    name          = enum_0.ToString();
            FieldInfo field         = enum_0.GetType().GetField(name);
            Type      attributeType = typeof(DescriptionAttribute);

            object[] customAttributes = field.GetCustomAttributes(attributeType, false);
            if ((customAttributes != null) && (customAttributes.Length > 0))
            {
                name = ((DescriptionAttribute)customAttributes[0]).Description;
            }
            return(name);
        }
Exemplo n.º 2
0
        public static IList ToList(Type type_0)
        {
            if (type_0 == null)
            {
                throw new ArgumentNullException("type");
            }
            if (!type_0.IsEnum)
            {
                throw new ArgumentException("Type provided must be an Enum.", "type");
            }
            ArrayList list = new ArrayList();

            foreach (ArithOperator enum2 in ArithOperator.GetValues(type_0))
            {
                list.Add(new KeyValuePair <Enum, string>(enum2, GetDescription(enum2)));
            }
            return(list);
        }
Exemplo n.º 3
0
        private Condition method_15(DataGridViewRow dataGridViewRow_0)
        {
            DataField tag = dataGridViewRow_0.Cells["clnField"].Tag as DataField;

            if ((tag != null) && (tag.DataType != FieldType.DataField))
            {
                BaseCondition condition = new BaseCondition {
                    Name      = dataGridViewRow_0.Cells["clnName"].Value.ToString(),
                    DataField = tag
                };
                string        str       = dataGridViewRow_0.Cells["clnRel"].Value.ToString();
                ArithOperator @operator = (ArithOperator)Enum.Parse(typeof(ArithOperator), str);
                condition.Operator    = @operator;
                condition.ValueType   = tag.DataType;
                condition.Value       = dataGridViewRow_0.Cells["clnValue"].Value.ToString();
                dataGridViewRow_0.Tag = condition;
                return(condition);
            }
            return(null);
        }