public bool SetPropertyValue(SteamAppPropertyType type, object?value, params string[] propertyPath)
        {
            var propertyTable = this;

            foreach (string text in propertyPath.Take(propertyPath.Length - 1))
            {
                if (propertyTable.HasProperty(new string[]
                {
                    text
                }))
                {
                    propertyTable = propertyTable.GetPropertyValue <SteamAppPropertyTable>(text, null);
                }
                else
                {
                    SteamAppPropertyTable propertyTable2 = new();
                    propertyTable.SetPropertyValue(text, SteamAppPropertyType.Table, propertyTable2);
                    propertyTable = propertyTable2;
                }
                if (propertyTable == null)
                {
                    return(false);
                }
            }
            return(propertyTable.SetPropertyValue(propertyPath.Last <string>(), type, value));
        }
        public SteamAppPropertyType GetPropertyType(string name)
        {
            SteamAppPropertyType result = SteamAppPropertyType._Invalid_;
            var property = this[name];

            if (property != null)
            {
                result = property.PropertyType;
            }
            return(result);
        }
        public bool SetPropertyValue(string name, SteamAppPropertyType type, object?value)
        {
            var property = this[name];

            if (property == null)
            {
                property = new SteamAppProperty(name);
                _properties.Add(property);
            }
            bool result = property.PropertyType != type || !property.Value !.Equals(value);

            property.PropertyType = type;
            property.Value        = value;
            return(result);
        }
Ejemplo n.º 4
0
 public SteamAppProperty(string name, SteamAppPropertyType type, object value)
 {
     Name      = name;
     _propType = type;
     _value    = value;
 }
        public void AddPropertyValue(string name, SteamAppPropertyType type, object?value)
        {
            SteamAppProperty item = new(name, type, value);

            _properties.Add(item);
        }