예제 #1
0
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="datas">数据组</param>
        /// <param name="data">添加的数据</param>
        /// <returns></returns>
        public static BigData[] AddData(this BigData[] datas, BigData data)
        {
            var ret = new List <BigData>();

            foreach (var item in datas)
            {
                ret.Add(item);
            }
            ret.Add(data);
            return(ret.ToArray());
        }
예제 #2
0
        /// <summary>
        /// 插槽数据转大数据
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static BigData[] ToBigDatas(this SlotData data, FileInfo file, bool isRead)
        {
            var ret = new BigData[7];

            ret[0] = new BigData("m_FileName", file.Name);
            ret[1] = new BigData("m_Name", data.m_Name);
            ret[2] = new BigData("m_DisplayName", data.m_DisplayName);
            ret[3] = new BigData("m_GameMode", data.m_GameMode);
            ret[4] = new BigData("m_VersionChangelistNumber", data.m_VersionChangelistNumber);
            ret[5] = new BigData("m_Timestamp", data.m_Timestamp.ToFileTimeUtc());
            ret[6] = isRead ? new BigData("m_FileTime", file.LastWriteTime.ToFileTimeUtc()) : new BigData("m_FileTime", "无");
            return(ret);
        }
예제 #3
0
        /// <summary>
        /// 查找单个数据
        /// </summary>
        /// <param name="datas">数据组</param>
        /// <param name="title">数据标题</param>
        /// <returns></returns>
        public static BigData SearchData(this BigData[] datas, string title)
        {
            BigData ret = new BigData();

            foreach (var item in datas)
            {
                if (item.Title == title)
                {
                    ret = item;
                }
            }
            return(ret);
        }
예제 #4
0
 /// <summary>
 /// 包含自己的构造
 /// </summary>
 /// <param name="title"></param>
 /// <param name="value"></param>
 public BigData(string title, BigData value) : this(title, value.ToString())
 {
 }