本文介绍了如何将嵌套字典传递给函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我有以下代码

Hi friends,
I have below code

internal static IDictionary<TopLevelTab, IDictionary<string, string>> DetailsViewMetaData;

        static DetailsView()
        {
            DetailsViewMetaData = new Dictionary<TopLevelTab, IDictionary<string, string>>
                                       {
                                           {
                                               TopLevelTab.Advertisers,
                                               DetailsViewSelector.CustomerAndAgencyDetailsColumnsSelectorLabelMapping
                                           },
                                           {
                                               TopLevelTab.Accounts,
                                               DetailsViewSelector.AccountDetailsColumnsSelectorLabelMapping
                                           },
                                           {
                                               TopLevelTab.Agencies,
                                               DetailsViewSelector.CustomerAndAgencyDetailsColumnsSelectorLabelMapping
                                           }
                                       };
        }

public void CheckDetails(TopLevelTab tab)
        {
            AS(DetailsViewMetaData[tab]);
        }

        private void AS(IDictionary<string,string> Labels)
        {
            var dataValidatorFactory = _framework.ValidatorAbstractFactory.CreateDataValidatorFactory();

            _framework.ScenarioRunnerFactory.CreateScenarioRunner()
                .Check(dataValidatorFactory.CreateElementLabelValidator(Labels))
                .Run();
        }





我想基于TopLevelTab值将嵌套字典传递给函数。这里TopLevelTab代表Enum。



提前致谢



I want to pass nested dictionary to the function based on the TopLevelTab value. Here TopLevelTab represent the Enum.

Thanks in advance

推荐答案

这篇关于如何将嵌套字典传递给函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 20:07