Beispiel #1
0
        /// <summary>
        /// Returns an already completed task with a given result.
        /// </summary>
        /// <returns>The completed task.</returns>
        internal static AppCenterTask <TResult> FromCompleted(TResult result)
        {
            var task = new AppCenterTask <TResult>();

            task.SetResult(result);
            return(task);
        }
        /// <summary>
        /// Returns an already completed task.
        /// </summary>
        /// <returns>The completed task.</returns>
        internal static AppCenterTask FromCompleted()
        {
            var task = new AppCenterTask();

            task.CompletionAction();
            return(task);
        }
 public static AppCenterTask <long> GetStorageSizeAsync()
 {
     if (_storageSizeTask == null)
     {
         _storageSizeTask = new AppCenterTask <long>();
     }
     return(_storageSizeTask);
 }
 public static AppCenterTask <string> GetLogUrlAsync()
 {
     if (_logUrlTask == null)
     {
         _logUrlTask = new AppCenterTask <string>();
     }
     return(_logUrlTask);
 }
 /// <summary>
 // Gets cached secret.
 /// </summary>
 public static AppCenterTask <string> GetSecretForPlatformAsync()
 {
     if (_secretTask == null)
     {
         _secretTask = new AppCenterTask <string>();
     }
     return(_secretTask);
 }
        /// <summary>
        /// Get the unique installation identifier for this application installation on this device.
        /// </summary>
        /// <remarks>
        /// The identifier is lost if clearing application data or uninstalling application.
        /// </remarks>
        public static AppCenterTask <Guid?> GetInstallIdAsync()
        {
            var stringTask = AppCenterInternal.GetInstallIdAsync();
            var guidTask   = new AppCenterTask <Guid?>();

            stringTask.ContinueWith(t =>
            {
                var installId = !string.IsNullOrEmpty(t.Result) ? new Guid(t.Result) : (Guid?)null;
                guidTask.SetResult(installId);
            });
            return(guidTask);
        }