//public static void SetPendingChanges(string connectionName, CellChangesCache cache) //{ // lock (PendingChanges) // { // if (PendingChanges.ContainsKey(connectionName)) // { // PendingChanges[connectionName] = cache; // } // else // { // PendingChanges.Add(connectionName, cache); // } // OnPendingChangesModified(connectionName); // } //} public static void AddPendingChanges(string connectionName, List <UpdateEntry> changes) { if (changes != null) { lock (PendingChanges) { CellChangesCache cache = GetPendingChanges(connectionName); foreach (var entry in changes) { cache.Add(entry); } OnPendingChangesModified(connectionName); } } }
public static CellChangesCache GetPendingChanges(string connectionName) { lock (PendingChanges) { if (PendingChanges.ContainsKey(connectionName)) { return(PendingChanges[connectionName]); } else { CellChangesCache cache = new CellChangesCache(); PendingChanges.Add(connectionName, cache); return(cache); } } }