Ejemplo n.º 1
0
        public bool SetPropertyValue(SteamAppPropertyType type, object value, params string[] propertyPath)
        {
            SteamAppPropertyTable 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));
        }
Ejemplo n.º 2
0
        public void RemoveProperty(params string[] propertyPath)
        {
            SteamAppPropertyTable 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;
                }
            }
            RemoveProperty(propertyPath.Last <string>());
        }