Пример #1
0
 public void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         Filename = DEFAULTFILENAME;
         stringResources.Clear();
     }
     else
     {
         filename = DEFAULTFILENAME;
         stringResources.Clear();
     }
 }
Пример #2
0
 void IStorage.Reinitialize(object config)
 {
     using (_keySpaces.Lock(LockType.Write))
     {
         _keySpaces.Clear();
     }
 }
Пример #3
0
        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));
        }