Beispiel #1
0
        public static Task <DataServiceResponse> SaveChangesAsync(this TableServiceContext context, SaveChangesOptions options)
        {
            var task = new APMTask <DataServiceResponse>(
                (callback, state) => context.BeginSaveChanges(options, callback, state),
                (asyncResult) => context.EndSaveChanges(asyncResult));

#if false
            return(task);
#else
            return(GetUnexpectedInternalClientErrorWrappedTask(Protocol.Constants.TableWorkaroundTimeout, task));
#endif
        }
Beispiel #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());
            }
        }
Beispiel #3
0
 private async Task SaveChangesAsync(TableServiceContext context, SaveChangesOptions options)
 {
     await this.StorageRetryPolicy.ExecuteAsync(this.CreateTask(
                                                    async => context.BeginSaveChanges(options, async, null),
                                                    res => context.EndSaveChanges(res)));
 }