public IWampRegistrationSubscriptionToken Register(IWampRpcOperation operation, RegisterOptions options)
        {
            options = options.WithDefaults();

            MatchRpcOperationCatalog catalog = GetInnerCatalog(options);

            return(catalog.Register(operation, options));
        }
        private MatchRpcOperationCatalog GetInnerCatalog(RegisterOptions options)
        {
            MatchRpcOperationCatalog result =
                mInnerCatalogs.FirstOrDefault
                    (innerCatalog => innerCatalog.Handles(options));

            if (result == null)
            {
                throw new WampException(WampErrors.InvalidOptions,
                                        "unknown match type: " + options.Match);
            }

            return(result);
        }