using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using UnityEngine.Scripting; namespace UnityEngine.Analytics { // Token: 0x020002D6 RID: 726 [StructLayout(LayoutKind.Sequential)] internal class CustomEventData : IDisposable { // Token: 0x06003002 RID: 12290 RVA: 0x000460F0 File Offset: 0x000442F0 private CustomEventData() { } // Token: 0x06003003 RID: 12291 RVA: 0x000460FC File Offset: 0x000442FC public CustomEventData(string name) { this.InternalCreate(name); } // Token: 0x06003004 RID: 12292 RVA: 0x0004610C File Offset: 0x0004430C ~CustomEventData() { this.InternalDestroy(); } // Token: 0x06003005 RID: 12293 RVA: 0x0004613C File Offset: 0x0004433C public void Dispose() { this.InternalDestroy(); GC.SuppressFinalize(this); } // Token: 0x06003006 RID: 12294 RVA: 0x0004614C File Offset: 0x0004434C public bool Add(string key, string value) { return this.AddString(key, value); } // Token: 0x06003007 RID: 12295 RVA: 0x0004616C File Offset: 0x0004436C public bool Add(string key, bool value) { return this.AddBool(key, value); } // Token: 0x06003008 RID: 12296 RVA: 0x0004618C File Offset: 0x0004438C public bool Add(string key, char value) { return this.AddChar(key, value); } // Token: 0x06003009 RID: 12297 RVA: 0x000461AC File Offset: 0x000443AC public bool Add(string key, byte value) { return this.AddByte(key, value); } // Token: 0x0600300A RID: 12298 RVA: 0x000461CC File Offset: 0x000443CC public bool Add(string key, sbyte value) { return this.AddSByte(key, value); } // Token: 0x0600300B RID: 12299 RVA: 0x000461EC File Offset: 0x000443EC public bool Add(string key, short value) { return this.AddInt16(key, value); } // Token: 0x0600300C RID: 12300 RVA: 0x0004620C File Offset: 0x0004440C public bool Add(string key, ushort value) { return this.AddUInt16(key, value); } // Token: 0x0600300D RID: 12301 RVA: 0x0004622C File Offset: 0x0004442C public bool Add(string key, int value) { return this.AddInt32(key, value); } // Token: 0x0600300E RID: 12302 RVA: 0x0004624C File Offset: 0x0004444C public bool Add(string key, uint value) { return this.AddUInt32(key, value); } // Token: 0x0600300F RID: 12303 RVA: 0x0004626C File Offset: 0x0004446C public bool Add(string key, long value) { return this.AddInt64(key, value); } // Token: 0x06003010 RID: 12304 RVA: 0x0004628C File Offset: 0x0004448C public bool Add(string key, ulong value) { return this.AddUInt64(key, value); } // Token: 0x06003011 RID: 12305 RVA: 0x000462AC File Offset: 0x000444AC public bool Add(string key, float value) { return this.AddDouble(key, (double)Convert.ToDecimal(value)); } // Token: 0x06003012 RID: 12306 RVA: 0x000462D4 File Offset: 0x000444D4 public bool Add(string key, double value) { return this.AddDouble(key, value); } // Token: 0x06003013 RID: 12307 RVA: 0x000462F4 File Offset: 0x000444F4 public bool Add(string key, decimal value) { return this.AddDouble(key, (double)Convert.ToDecimal(value)); } // Token: 0x06003014 RID: 12308 RVA: 0x0004631C File Offset: 0x0004451C public bool Add(IDictionary eventData) { foreach (KeyValuePair keyValuePair in eventData) { string key = keyValuePair.Key; object value = keyValuePair.Value; if (value == null) { this.Add(key, "null"); } else { Type type = value.GetType(); if (type == typeof(string)) { this.Add(key, (string)value); } else if (type == typeof(char)) { this.Add(key, (char)value); } else if (type == typeof(sbyte)) { this.Add(key, (sbyte)value); } else if (type == typeof(byte)) { this.Add(key, (byte)value); } else if (type == typeof(short)) { this.Add(key, (short)value); } else if (type == typeof(ushort)) { this.Add(key, (ushort)value); } else if (type == typeof(int)) { this.Add(key, (int)value); } else if (type == typeof(uint)) { this.Add(keyValuePair.Key, (uint)value); } else if (type == typeof(long)) { this.Add(key, (long)value); } else if (type == typeof(ulong)) { this.Add(key, (ulong)value); } else if (type == typeof(bool)) { this.Add(key, (bool)value); } else if (type == typeof(float)) { this.Add(key, (float)value); } else if (type == typeof(double)) { this.Add(key, (double)value); } else if (type == typeof(decimal)) { this.Add(key, (decimal)value); } else { if (!type.IsValueType) { throw new ArgumentException(string.Format("Invalid type: {0} passed", type)); } this.Add(key, value.ToString()); } } } return true; } // Token: 0x06003015 RID: 12309 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] public extern void InternalCreate(string name); // Token: 0x06003016 RID: 12310 [ThreadAndSerializationSafe] [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] internal extern void InternalDestroy(); // Token: 0x06003017 RID: 12311 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddString(string key, string value); // Token: 0x06003018 RID: 12312 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddBool(string key, bool value); // Token: 0x06003019 RID: 12313 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddChar(string key, char value); // Token: 0x0600301A RID: 12314 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddByte(string key, byte value); // Token: 0x0600301B RID: 12315 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddSByte(string key, sbyte value); // Token: 0x0600301C RID: 12316 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddInt16(string key, short value); // Token: 0x0600301D RID: 12317 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddUInt16(string key, ushort value); // Token: 0x0600301E RID: 12318 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddInt32(string key, int value); // Token: 0x0600301F RID: 12319 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddUInt32(string key, uint value); // Token: 0x06003020 RID: 12320 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddInt64(string key, long value); // Token: 0x06003021 RID: 12321 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddUInt64(string key, ulong value); // Token: 0x06003022 RID: 12322 [GeneratedByOldBindingsGenerator] [MethodImpl(MethodImplOptions.InternalCall)] private extern bool AddDouble(string key, double value); // Token: 0x0400097F RID: 2431 [NonSerialized] internal IntPtr m_Ptr; } }