我有以下代码我需要使用 foreach 的 3 个参数:
Dictionary<string, Dictionary<string, Action>>
我尝试过使用 aDictionaryEntry和 aKeyValuePair但他们继续返回 2 个值而不是 3 个。
编辑:我正在尝试使用元组,并且正在尝试将其实现到我的代码中,但我无法访问列表(元素)中的元组。代码:
                    foreach (List<Tuple<string, string, Action>> element in Classes)
                    {
                        if (ActualText.StartsWith(element.Item1))
                        {
                            string temp1 = ActualText.TrimStart(element.Item1.ToArray());
                            if (temp1 == element.Item2)
                                element.Item3();
                            else
                                print("Unknown extension " + temp1);
                        }
                    }