Пример #1
0
        public static string GetValue(DualKeyedDictionary <string, string, string> info,
                                      string search)
        {
            string retval = "";

            var x = info["A"];

            Dictionary <string, string> mydict;

            mydict = x;

            // string myval = x.Value;

            foreach (var outerEntry in info)
            {
                if (outerEntry.Key == search)
                {
                    foreach (var innerEntry in outerEntry.Value)
                    {
                        Console.WriteLine("Key:{0} Value:{1}", innerEntry.Key, innerEntry.Value);
                        retval = innerEntry.Value;
                    }
                }
            }
            return(retval);
        }
Пример #2
0
        static void Main(string[] args)
        {
            DualKeyedDictionary <string, string, string> info = new DualKeyedDictionary <string, string, string>();

            info.Add("A", "B", "C");
            info.Add("1", "2", "3");


            string temp = GetValue(info, "A");

            //foreach (var outerEntry in info)
            //{
            //    foreach (var innerEntry in outerEntry.Value)
            //    {
            //        Console.WriteLine("Key:{0} Value:{1}", innerEntry.Key, innerEntry.Value);
            //    }
            //}
        }