/// <nodoc/>
        public static string GetCommandName(this DiscriminatingUnion <string, IJavaScriptCommand> command)
        {
            if (command.GetValue() is string simpleCommand)
            {
                return(simpleCommand);
            }

            return(((IJavaScriptCommand)command.GetValue()).Command);
        }
Example #2
0
        /// <nodoc/>
        public static string GetCommandName(this DiscriminatingUnion <string, IJavaScriptCommand, IJavaScriptCommandGroupWithDependencies, IJavaScriptCommandGroup> command)
        {
            object value = command.GetValue();

            if (value is string simpleCommand)
            {
                return(simpleCommand);
            }
            else if (value is IJavaScriptCommand)
            {
                return(((IJavaScriptCommand)command.GetValue()).Command);
            }

            return(((IJavaScriptCommandGroup)command.GetValue()).CommandName);
        }