public void Clear(bool RaiseChangedEvent) { if (RaiseChangedEvent) { Filename = DEFAULTFILENAME; stringResources.Clear(); } else { filename = DEFAULTFILENAME; stringResources.Clear(); } }
void IStorage.Reinitialize(object config) { using (_keySpaces.Lock(LockType.Write)) { _keySpaces.Clear(); } }
public void TestLockedSet() { var ld = new LockingDictionary <int, string>().Locked; Assert.ThrowsException <NotSupportedException>(() => ld[0] = "zero"); Assert.ThrowsException <NotSupportedException>(() => ld.Add(0, "zero")); Assert.ThrowsException <NotSupportedException>(() => ld.Clear()); Assert.ThrowsException <NotSupportedException>(() => ld.Remove(1)); }