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); } }
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); } }
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); }
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); }
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); }