Beispiel #1
0
        public void AddLookups(QuotePage[] pages)
        {
            // precondition checking
            if (pages == null)
            {
                throw new ArgumentNullException();
            }
            else if (pages.Length == 0)
            {
                throw new ArgumentException();
            }

            foreach (QuotePage page in pages)
            {
                if (page == null)
                {
                    throw new ArgumentException();
                }
                else if (!_cultureMapper.Contains(page.Culture))
                {
                    throw new CultureNotSupportedException(page.Culture);
                }
            }

            IsBusy = true;

            AsyncEnumerator asyncEnumerator = GetAsyncEnumerator();

            asyncEnumerator.BeginExecute(ProcessUpdateLookups(asyncEnumerator, pages), asyncEnumerator.EndExecute);
        }
Beispiel #2
0
        public Uri GetUri(string topic, CultureInfo culture)
        {
            // precondition checking
            if (topic == null || culture == null)
            {
                throw new ArgumentNullException();
            }
            else if (topic.Length == 0)
            {
                throw new ArgumentException();
            }
            else if (!_cultureMapper.Contains(culture))
            {
                throw new CultureNotSupportedException(culture);
            }

            UriBuilder uriBuilder = new UriBuilder(_cultureMapper[culture].BaseUri)
            {
                Path = UriDefaultWikiPath + topic.Replace(' ', '_')
            };

            return(uriBuilder.Uri);
        }