CK.RouteConfig.Impl.ProtoResolver.RegisterSubRoute C# (CSharp) Method

RegisterSubRoute() private method

private RegisterSubRoute ( IProtoSubRoute r ) : bool
r IProtoSubRoute
return bool
        bool RegisterSubRoute( IProtoSubRoute r )
        {
            if( NamedSubRoutes.ContainsKey( r.FullName ) ) return false;
            NamedSubRoutes.Add( r.FullName, r );
            return true;
        }

Usage Example

コード例 #1
0
            bool IProtoRouteConfigurationContext.AddRoute(SubRouteConfiguration route)
            {
                if (route == null)
                {
                    throw new ArgumentNullException();
                }
                var newSub = new Route(_resolver, this, route);

                if (!_resolver.RegisterSubRoute(newSub))
                {
                    Monitor.SendLine(LogLevel.Error, string.Format("Route named '{0}' is already declared.", newSub._fullName), null);
                    return(false);
                }
                using (Monitor.OpenGroup(LogLevel.Info, string.Format("Preprocessing route '{0}'.", newSub._fullName), null))
                {
                    newSub.ExecuteMetaConfigurations();
                    _subRoutes.Add(newSub);
                }
                return(true);
            }