Beispiel #1
0
 /// <summary>
 ///		Create a thread safety Dictionary with a owner secret and a initial Inner Dictionary;
 /// </summary>
 /// <param name="ownerSecret">only who has the ownerSecret can modify this dictionary</param>
 /// <param name="innerDic">initial Inner Dictionary</param>
 public SafeDictionary(object ownerSecret, Dictionary <K, V> innerDic)
 {
     _readonly    = false;
     _ownerSecret = ownerSecret;
     _innerDic    = innerDic;
     _innerLock   = new IICReaderWriterLock();
 }
Beispiel #2
0
 private SafeList(SerializationInfo info, StreamingContext context)
 {
     _innerList   = (List <T>)info.GetValue("innerList", typeof(List <T>));
     _ownerSecret = info.GetValue("ownerSecret", typeof(object));
     _innerLock   = new IICReaderWriterLock();
 }
Beispiel #3
0
 /// <summary>
 ///		Create a Thread Safety List of T with a owner secret and initial innet List
 /// </summary>
 /// <param name="ownerSecret">only who has the ownerSecret can modify this list</param>
 /// <param name="innerList">initial innet List</param>
 public SafeList(object ownerSecret, List <T> innerList)
 {
     _ownerSecret = ownerSecret;
     _innerList   = innerList;
     _innerLock   = new IICReaderWriterLock();
 }