Exemplo n.º 1
0
        static void PopulateDictionaryQuery()
        {
            using (DictionaryQuery <string> dic = cx.DictionaryQuery <string>("assembly"))
            {
                Debug.WriteLine("Adding assembly informations to 'assembly'.");

                Assembly a = Assembly.GetExecutingAssembly();
                dic.Add("Name", a.FullName);
                dic.Add("Version", a.GetName().Version.ToString());
                dic.Add("done", "");
            }
        }
Exemplo n.º 2
0
        static void TestParallelModifications()
        {
            using (DictionaryQuery <string> dic = cx.DictionaryQuery <string>("parallel"))
            {
                dic.Add("hello", "world");
                dic["hello"].ShouldBe("world");

                using (DictionaryQuery <string> pdic = cx.DictionaryQuery <string>("parallel"))
                {
                    pdic["hello"] = "you";
                }

                dic.ShouldContainKey("hello");
                dic["hello"].ShouldBe("you");
                dic.Clear();
            }
        }