public static Dictionary <K, Dictionary <K2, V2> > ToDictionary <K, K2, V2>(ThreadedDictionary <K, ThreadedDictionary <K2, V2> > TD2KV) { Dictionary <K, Dictionary <K2, V2> > D2KV = new Dictionary <K, Dictionary <K2, V2> >(); foreach (KeyValuePair <K, ThreadedDictionary <K2, V2> > KVP2 in TD2KV) { D2KV.Add(KVP2.Key, (Dictionary <K2, V2>)KVP2.Value); } return(D2KV); }
public static ThreadedDictionary <K, ThreadedDictionary <K2, V2> > ToThreadedDictionary <K, K2, V2>(Dictionary <K, Dictionary <K2, V2> > D2KV) { ThreadedDictionary <K, ThreadedDictionary <K2, V2> > TD2KV = new ThreadedDictionary <K, ThreadedDictionary <K2, V2> >(); foreach (KeyValuePair <K, Dictionary <K2, V2> > KVP2 in D2KV) { TD2KV.Add(KVP2.Key, (ThreadedDictionary <K2, V2>)KVP2.Value); } return(TD2KV); }
/// <summary> /// ThreadedDictionary{TK2, ThreadedDictionary {TK3, TV3>> that /// returns that[key2].ValuesArray; /// </summary> /// <typeparam name="TK2"></typeparam> /// <typeparam name="TK3"></typeparam> /// <typeparam name="TV3"></typeparam> /// <param name="key1"></param> /// <param name="key2"></param> /// <returns></returns> public TV3[] GetValuesArray <TK2, TK3, TV3>(TKey key1, TK2 key2) { lock (locker) { if (base.ContainsKey(key1) && base[key1] != null) { ThreadedDictionary <TK2, ThreadedDictionary <TK3, TV3> > that = base[key1] as ThreadedDictionary <TK2, ThreadedDictionary <TK3, TV3> >; if (that != null && that.ContainsKey(key2)) { return(that[key2].ValuesArray); } } } return(null); }
/// <summary> /// This constructor allows you to create instance of Threaded Timers that can be used to run and manage multible asychnonic timer at once. /// </summary> /// <param name="maxThreadsCount">Maximum count of existing timers.</param> /// <param name="TPriority">Priority of thread inside timers.</param> public ThreadedTimers(int maxThreadsCount = int.MaxValue) { MaxThreadsCount = maxThreadsCount; Workers = new ThreadedDictionary <string, ThreadedTimer>(); }
/// <summary> /// This is data buffer, that consist of Dictionary of DataTime and string data, where data is in conjuicntion with time in relation to Set Time. /// </summary> public DataBuffer() { DDTSBuffer = new ThreadedDictionary <TickTime, string>(); }