Esempio n. 1
0
            public TypedValue Data(ComponentDataList list, TGIBlockList tgiBlocks)
            {
                if (!ComponentDataMap.ContainsKey(element))
                {
                    return(null);
                }
                if (!list.ContainsKey(ComponentDataMap[element]))
                {
                    return(null);
                }
                ComponentDataType cd = list[ComponentDataMap[element]];

                System.Reflection.PropertyInfo pi = cd.GetType().GetProperty("Data");
                if (pi == null || !pi.CanRead)
                {
                    return(null);
                }
                if (element == Component.Footprint || element == Component.Model || element == Component.Tree)
                {
                    return(new TypedValue(typeof(TGIBlock), tgiBlocks[(int)pi.GetValue(cd, null)], "X"));
                }
                else
                {
                    return(new TypedValue(pi.PropertyType, pi.GetValue(cd, null), "X"));
                }
            }
Esempio n. 2
0
            public override int CompareTo(ComponentDataType other)
            {
                if (this.GetType() != other.GetType())
                {
                    return(-1);
                }
                CDTUInt32 oth = (CDTUInt32)other;
                int       res = key.CompareTo(oth.key); if (res != 0)

                {
                    return(res);
                }

                res = controlCode.CompareTo(oth.controlCode); if (res != 0)
                {
                    return(res);
                }
                return(data.CompareTo(oth.data));
            }