Example #1
0
        public static void SetBytes(string resName, int recordId, byte[] data)
        {
            TMPStore rs = null;

            try
            {
                rs = TMPStore.OpenRecordStore(resName, true);
                if (rs.GetNumRecords() == 0)
                {
                    rs.AddRecord(data, 0, data.Length);
                }
                else
                {
                    rs.SetRecord(recordId, data, 0, data.Length);
                }
            }
            catch (Exception ex)
            {
                Loon.Utils.Debugging.Log.Exception(ex);
            }
            finally
            {
                CloseRecordStore(rs);
            }
        }
Example #2
0
        public static int AddBytes(string resName, byte[] data)
        {
            TMPStore rs     = null;
            bool     opened = false;

            try
            {
                rs     = TMPStore.OpenRecordStore(resName, true);
                opened = true;
                return(rs.AddRecord(data, 0, data.Length));
            }
            catch (Exception ex)
            {
                Loon.Utils.Debugging.Log.Exception(ex);
            }
            finally
            {
                CloseRecordStore(rs);
            }
            return(opened ? COULD_NOT_SAVE : COULD_NOT_OPEN);
        }