Exemple #1
0
        /// <summary>
        /// Sets the specific property value
        /// </summary>
        public bool SetVariableValue(string variableName, string json)
        {
            var result = string.Empty;

            if (RegisteredVariables.Any(r => string.Compare(r.RegisteredName, variableName) == 0))
            {
                var variable = RegisteredVariables.First(r => string.Compare(r.RegisteredName, variableName) == 0);
                if (variable.IsDirectReference)
                {
                    return(false); //not done this part yet
                }
                else
                {
                    return(SetPropertyValue(variable, json));
                }
            }

            return(false);
        }
Exemple #2
0
        /// <summary>
        /// Converts the registered variable to a string
        /// </summary>
        public string GetVariableValue(string variableName)
        {
            var result = string.Empty;

            if (RegisteredVariables.Any(r => string.Compare(r.RegisteredName, variableName) == 0))
            {
                var variable = RegisteredVariables.First(r => string.Compare(r.RegisteredName, variableName) == 0);
                if (variable.IsDirectReference)
                {
                    result = InstanceAsString(((Ref)variable.Reference).RawValue);
                }
                else
                {
                    result = InstanceAsString(GetPropertyValue(variable));
                }
            }

            return(result);
        }