CK.RouteConfig.Impl.MetaConfiguration.CheckActionNameValidity C# (CSharp) Method

CheckActionNameValidity() static public method

Implements standard name checking for ActionConfiguration.Name. The provided nameToCheck must not be null or empty or contains only whitespaces nor '/' character. The '/' is reserved to structure the namespace.
static public CheckActionNameValidity ( string routeName, IActivityMonitor monitor, string nameToCheck ) : bool
routeName string The name of the route that contains the action.
monitor IActivityMonitor The monitor that will receive error descriptions.
nameToCheck string The name to check.
return bool
        static public bool CheckActionNameValidity( string routeName, IActivityMonitor monitor, string nameToCheck )
        {
            if( String.IsNullOrWhiteSpace( nameToCheck ) ) monitor.SendLine( LogLevel.Error, string.Format( "Invalid name '{0}' in route '{1}'. Name must not be empty or contains only white space.", nameToCheck, routeName ), null );
            else if( nameToCheck.Contains( '/' ) ) monitor.SendLine( LogLevel.Error, string.Format( "Invalid name '{0}' in route '{1}'. Name must not contain '/'.", nameToCheck, routeName ), null );
            else return true;
            return false;
        }