Пример #1
0
        // typed getters
        internal bool GetBoolProperty(string name)
        {
            var ret = GetProperty(IdentValue.Create(name));

            if (ret == null)
            {
                return(false);
            }
            if (ret.DataType == DataTypes.Bool)
            {
                return(ret == BoolValue.True);
            }
            if (ret.DataType == DataTypes.Text)
            {
                return(ret.AsString.ToLower() == "true");
            }
            if (ret.DataType == DataTypes.Number)
            {
                return((ret as NumberValue).Value != 0);
            }
            return(false);
        }
Пример #2
0
        internal string GetStringProperty(string name)
        {
            var ret = GetProperty(IdentValue.Create(name));

            return((ret == null) ? null : ret.AsString);
        }
Пример #3
0
        internal int GetIntProperty(string name)
        {
            var ret = GetProperty(IdentValue.Create(name));

            return((ret == null) ? 0 : (int)(ret as NumberValue).Value);
        }
Пример #4
0
 internal TypedValue GetProperty(string name)
 {
     return(GetProperty(IdentValue.Create(name)));
 }
Пример #5
0
 internal void SetProperty(string name, TypedValue value)
 {
     PropertyLookup[IdentValue.Create(name)] = value;
 }