private IEnumerable <string> BuildInfo(FoundFeatureInfo foundFeatureInfo)
        {
            if (foundFeatureInfo.IsCommandHandler)
            {
                return(foundFeatureInfo.FeatureInfo.BuildInfo(foundFeatureInfo.CommandHandlerInfo.Type, Connection));
            }

            if (foundFeatureInfo.IsExtension)
            {
                return(foundFeatureInfo.FeatureInfo.BuildInfo(foundFeatureInfo.ExtensionInfo.Type, Connection));
            }

            if (foundFeatureInfo.IsAuthenticationMechanism)
            {
                return(foundFeatureInfo.FeatureInfo.BuildInfo(foundFeatureInfo.AuthenticationMechanism.GetType(), Connection));
            }

            throw new NotSupportedException("Unknown feature source.");
        }
        private bool IsFeatureAllowed(FoundFeatureInfo foundFeatureInfo, bool isAuthorized)
        {
            if (foundFeatureInfo.IsCommandHandler)
            {
                return(isAuthorized || !foundFeatureInfo.CommandHandlerInfo.IsLoginRequired);
            }

            if (foundFeatureInfo.IsExtension)
            {
                return(isAuthorized || !foundFeatureInfo.ExtensionInfo.IsLoginRequired);
            }

            if (foundFeatureInfo.IsAuthenticationMechanism)
            {
                return(true);
            }

            throw new NotSupportedException("Unknown feature source.");
        }