/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Microsoft.Management.UI.Internal/ManagementList/Common/CommandHelper.cs
50 строк
1 KB
Steve Lee
Update copyright notice to latest guidance (#12190)
24 мар 2020, 21:08
Не верифицирован
24 мар 2020, 21:08
b7cb335
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Security; using System.Text; using System.Windows; using System.Windows.Input; namespace Microsoft.Management.UI.Internal { internal static class CommandHelper { internal static void ExecuteCommand(ICommand command, object parameter, IInputElement target) { RoutedCommand command2 = command as RoutedCommand; if (command2 != null) { if (command2.CanExecute(parameter, target)) { command2.Execute(parameter, target); } } else if (command.CanExecute(parameter)) { command.Execute(parameter); } } internal static bool CanExecuteCommand(ICommand command, object parameter, IInputElement target) { if (command == null) { return false; } RoutedCommand command2 = command as RoutedCommand; if (command2 != null) { return command2.CanExecute(parameter, target); } else { return command.CanExecute(parameter); } } } }