예제 #1
0
        private static string GetCommand(string path, string name)
        {
            foreach (string collection in _menu.GetAllItems())
            {
                if (collection.Equals(path, StringComparison.OrdinalIgnoreCase))
                {
                    foreach (string command in _menu.GetItem(collection).GetAllItems())
                    {
                        if (command.Equals(name, StringComparison.OrdinalIgnoreCase))
                        {
                            return(_menu.GetItem(collection).GetItem(command).Command);
                        }
                    }
                }
            }

            return(null);
        }