Beispiel #1
0
        public static void UnlockMethod([CallerMemberName] string method = "",
                                        [CallerFilePath] string file     = "")
        {
            try
            {
                string id = method + file.ToString();

                lockedOperations.Remove(id);
            }
            catch (Exception e)
            {
                Crashlytics.Log(e);
            }
        }
Beispiel #2
0
 public static void CancelMethod(string methodName, [CallerFilePath] string file = "")
 {
     try
     {
         string id = methodName + file.ToString();
         if (operations.ContainsKey(id))
         {
             operations.Remove(id);
         }
     }
     catch (Exception e)
     {
         Crashlytics.Log(e);
     }
 }
Beispiel #3
0
        public static bool CompareGUID(Guid guid, [CallerMemberName] string method = "",
                                       [CallerFilePath] string file = "")
        {
            try
            {
                string id = method + file.ToString();
                return(operations.ContainsKey(id) && operations[id] == guid);
            }
            catch (Exception e)
            {
                Crashlytics.Log(e);
            }

            return(false);
        }
Beispiel #4
0
        public static bool LockMethod([CallerMemberName] string method = "",
                                      [CallerFilePath] string file     = "")
        {
            try
            {
                string id = method + file.ToString();
                if (lockedOperations.Contains(id))
                {
                    return(false);
                }

                lockedOperations.Add(id);
                return(true);
            }
            catch (Exception e)
            {
                Crashlytics.Log(e);
            }

            return(false);
        }
Beispiel #5
0
        public static Guid GenerateGUID([CallerMemberName] string method = "",
                                        [CallerFilePath] string file     = "")
        {
            try
            {
                string id = method + file.ToString();
                if (operations.ContainsKey(id))
                {
                    operations.Remove(id);
                }

                operations.Add(id, Guid.NewGuid());
                return(operations[id]);
            }
            catch (Exception e)
            {
                Crashlytics.Log(e);
            }

            return(Guid.Empty);
        }