예제 #1
0
        /// <summary>
        /// Change to another specified domain.
        /// </summary>
        /// <param name="domainItem">DomainItem.</param>
        public void ChangeDomain(DomainItem domainItem)
        {
            if (domainItem == null)
            {
                throw new ArgumentNullException();
            }

            _domains.Clear();
            _domains.Add(domainItem.Value, domainItem.Clone());
        }
예제 #2
0
        /// <summary>
        /// Add domain.
        /// </summary>
        /// <param name="domainItem">DomainItem.</param>
        /// <returns>Whether imported.</returns>
        public bool ImportDomainItem(DomainItem domainItem)
        {
            if (domainItem == null)
            {
                throw new ArgumentNullException();
            }

            bool imported = false;
            if (_domains.Count == 0)
            {
                _domains.Add(DomainItem.GeneralDomain, new DomainItem());
            }

            if (!_domains.ContainsKey(domainItem.Value))
            {
                _domains.Add(domainItem.Value, domainItem.Clone());
                imported = true;
            }

            return imported;
        }