Exemplo n.º 1
0
        /// <summary>
        /// Report Crash Statistic to Azure Tables
        /// </summary>
        /// <param name="exceptionName">The exception name</param>
        /// <param name="StackTrace"> The full stacktrace string</param>
        public static void ReportWebStatCrash(string exceptionName, string stackTrace)
        {
            // This should not run while running in the emulator
            if (Microsoft.Devices.Environment.DeviceType == Microsoft.Devices.DeviceType.Emulator)
            {
                return;
            }

            try
            {
                var tableName = "WazeCrashLog";

                var wazeCrashLog = new WazeCrashLog
                {
                    DeviceID   = deviceID,
                    Lang       = LanguageResources.Instance.CurrentLanguage,
                    Ver        = GamePage.get().GetAppVersion(),
                    DeviceType = Microsoft.Phone.Info.DeviceStatus.DeviceName,
                    Exception  = exceptionName,
                    StackTrace = stackTrace,
                    Timestamp  = DateTime.Now
                };

                context.AddObject(tableName, wazeCrashLog);


                context.BeginSaveChanges(
                    asyncResult =>
                {
                    TableSaveCallBack(context, asyncResult);
                },
                    null);
            }
            catch (Exception exc)
            {
                System.Diagnostics.Debug.WriteLine(exc.ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Report Crash Statistic to Azure Tables
        /// </summary>
        /// <param name="exceptionName">The exception name</param>
        /// <param name="StackTrace"> The full stacktrace string</param>
        public static void ReportWebStatCrash(string exceptionName, string stackTrace)
        {
            // This should not run while running in the emulator
            if (Microsoft.Devices.Environment.DeviceType == Microsoft.Devices.DeviceType.Emulator)
            {
                return;
            }

            try
            {

                var tableName = "WazeCrashLog";

                var wazeCrashLog = new WazeCrashLog
                {
                    DeviceID = deviceID,
                    Lang = LanguageResources.Instance.CurrentLanguage,
                    Ver = GamePage.get().GetAppVersion(),
                    DeviceType = Microsoft.Phone.Info.DeviceStatus.DeviceName,
                    Exception = exceptionName,
                    StackTrace = stackTrace,
                    Timestamp = DateTime.Now
                };

                context.AddObject(tableName, wazeCrashLog);

                context.BeginSaveChanges(
                            asyncResult =>
                            {
                                TableSaveCallBack(context, asyncResult);

                            },
                            null);

            }
            catch (Exception exc)
            {
                System.Diagnostics.Debug.WriteLine(exc.ToString());
            }
        }