Exemplo n.º 1
0
        public bool SetProperty(string valueName, string valueStr)
        {
            DesignerPropertyEditor propertyEditor = getPropertyEditor(valueName);

            if (propertyEditor == null)
            {
                return(false);
            }

            VariableDef var = propertyEditor.GetVariable();

            if (var.Value.ToString().ToLower() != valueStr.ToLower())
            {
                Plugin.InvokeTypeParser(null, var.GetValueType(), valueStr, (object value) => var.Value = value, null);

                propertyEditor.ValueWasnotAssigned();

                propertyEditor.SetVariable(var, null);

                propertyEditor.ValueWasAssigned();

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public Type GetValueType()
        {
            if (_valueClass == kConst || _valueClass == kPar)
            {
                if (_value != null)
                {
                    ParInfo parInfo = _value as ParInfo;
                    if (parInfo != null)
                    {
                        VariableDef var = parInfo.Variable;
                        if (var != null)
                        {
                            return(var.GetValueType());
                        }
                    }
                    else
                    {
                        return(_value.GetType());
                    }
                }
            }
            else if (_property != null)
            {
                return(_property.Type);
            }

            return(null);
        }