Beispiel #1
0
        public IList <T> GetArray <T>(string name)
        {
            DataArray array = GetSubtree(name);

            if (array == null)
            {
                return(null);
            }

            int count = array.GetValue <int>("count");

            DataArray items = array.GetSubtree("data");

            if (items == null)
            {
                return(null);
            }

            T[] ret = new T[count];
            for (int i = 0; i < count; i++)
            {
                ret[i] = items.GetValue <T>(i);
            }

            return(ret);
        }
Beispiel #2
0
        public static SongsDTA GetSongsDTA(SongData song)
        {
            DataArray tree = song.Data.GetSubtree("HmxSongsDtb");

            if (tree != null)
            {
                return(SongsDTA.Create(tree.GetSubtree()));
            }
            return(null);
        }
Beispiel #3
0
        public void SetArray <T>(string name, IList <T> value)
        {
            DataArray subtree = GetSubtree(name, true);

            subtree.SetValue("count", value.Count);
            DataArray data = subtree.GetSubtree("data", true);

            for (int i = 0; i < value.Count; i++)
            {
                data.InternalSetValue(value[i], i);
            }

            RaisePropertyChangedEvent();
        }