public void Register(IDocumentService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            if (service.SupportedSchemes == null || service.SupportedSchemes.Length == 0)
            {
                throw new ArgumentException("service", "one or more supported schemes required");
            }

            foreach (var scheme in service.SupportedSchemes)
            {
                var normalizedScheme = DocumentServiceManager.NormalizeScheme(scheme);
                this.LogInfo("registering DocumentService for scheme '{0}'", normalizedScheme);

                IDocumentService existedService;
                if (_services.TryGetValue(normalizedScheme, out existedService))
                {
                    this.LogWarning("a DocumentService of file type '{0}' is already existed, it will be replaced",
                                    normalizedScheme);
                }

                _services[normalizedScheme] = service;
            }
        }
        public IDocumentService GetDocumentService(string scheme)
        {
            scheme = DocumentServiceManager.NormalizeScheme(scheme);
            IDocumentService service;

            if (_services.TryGetValue(scheme, out service))
            {
                return(service);
            }

            return(null);
        }
 static DocumentServiceManager()
 {
     DocumentServiceManager.Instance = new DocumentServiceManager();
     DocumentServiceManager.Instance.Register(InternalDocumentService.Instance);
 }