Exemplo n.º 1
0
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "inds": data.ToList(out _tmpDecodeInds); break;

            case "vals": List <T> tmps; data.ToList(out tmps);
                for (int i = 0; i < tmps.Count; i++)
                {
                    var tmp = tmps[i];
                    if (!tmp.Equals(default(T)))
                    {
                        this[_tmpDecodeInds[i]] = tmp;
                    }
                }
                count          = tmps.Count;
                _tmpDecodeInds = null;
                break;

            case "brws": _edited = data.ToInt(0); break;

            case "last": lastFreeIndex = data.ToInt(0); break;

            case "add": _allowAdd = data.ToBool(); break;

            case "del": _allowDelete = data.ToBool(); break;

            default:
                // Legacy method:
                this[ToInt(key)] = data.Decode <T>(); break;
            }
        }
            public override void Decode(string key, CfgData data)
            {
                switch (key)
                {
                case "b":
                    data.Decode(base.Decode);
                    break;

                case "tgs":
                    data.ToList(out _usageTags);
                    break;
                }
            }