예제 #1
0
        public PropertyItem GetValue(IOutput output, IPropertyProvider propertyProvider, IPropertyStore propertyStore, ProcessorItem item)
        {
            switch (Type)
            {
            case OperandType.ItemProperty:
                PropertyItem propertyItem = item.GetProperty(propertyProvider, ValueText);

                if (propertyItem != null)
                {
                    return(propertyItem);
                }

                output.WriteLine(Level.Fine, $"  &-c;Item property named '&-e;{ValueText}&-^;' doesn't exist...&-^;");
                return(null);

            case OperandType.GlobalProperty:
                PropertyItem property = propertyStore.GetProperty(ValueText);
                if (property != null)
                {
                    return(property);
                }

                output.WriteLine(Level.Fine, $"  &-c;Global property named '&-e;{ValueText}&-^;' doesn't exist...&-^;");
                return(null);

            case OperandType.NumericConstant:
                return(new PropertyItem(ValueNumeric, Unit));

            case OperandType.TextConstant:
                return(new PropertyItem(ValueText));

            default:
                return(null);
            }
        }
예제 #2
0
        public PropertyItem GetProperty(IPropertyProvider propertyProvider, IPropertyStore propertyStore, ProcessorItem item)
        {
            switch (Type)
            {
            case PropertyType.Global:
                return(propertyStore.GetProperty(Value));

            case PropertyType.Item:
                return(item.GetProperty(propertyProvider, Value));

            case PropertyType.Text:
            default:
                return(null);
            }
        }