コード例 #1
0
 /// <summary>Clone constructor. Generates a new <see cref="TypedElementSettings"/> instance initialized from the state of the specified instance.</summary>
 /// <exception cref="ArgumentNullException">The specified argument is <c>null</c>.</exception>
 public TypedElementSettings(TypedElementSettings other)
 {
     if (other == null)
     {
         throw Error.ArgumentNull(nameof(other));
     }
     other.CopyTo(this);
 }
コード例 #2
0
        /// <summary>Copy all configuration settings to another instance.</summary>
        /// <param name="other">Another <see cref="TypedElementSettings"/> instance.</param>
        /// <exception cref="ArgumentNullException">The specified argument is <c>null</c>.</exception>
        public void CopyTo(TypedElementSettings other)
        {
            if (other == null)
            {
                throw Error.ArgumentNull(nameof(other));
            }

            other.ErrorMode = ErrorMode;
        }
コード例 #3
0
        /// <summary>Copy all configuration settings to another instance.</summary>
        /// <param name="other">Another <see cref="TypedElementSettings"/> instance.</param>
        /// <exception cref="ArgumentNullException">The specified argument is <c>null</c>.</exception>
        public void CopyTo(TypedElementSettings other)
        {
            if (other == null)
            {
                throw Error.ArgumentNull(nameof(other));
            }

            other.ErrorMode = ErrorMode;
#pragma warning disable CS0618 // Type or member is obsolete
            other.TruncateDateTimeToDate = TruncateDateTimeToDate;
#pragma warning restore CS0618 // Type or member is obsolete
        }
コード例 #4
0
        public TypedElementNode(ISourceNode element, string type, IStructureDefinitionSummaryProvider provider, TypedElementSettings settings = null)
        {
            if (element == null)
            {
                throw Error.ArgumentNull(nameof(element));
            }

            Provider  = provider ?? throw Error.ArgumentNull(nameof(provider));
            _settings = settings ?? new TypedElementSettings();

            if (element is IExceptionSource ies && ies.ExceptionHandler == null)
            {
                ies.ExceptionHandler = (o, a) => ExceptionHandler.NotifyOrThrow(o, a);
            }

            ShortPath = element.Name;
            Current   = buildRootPosition(element, type, provider);
        }
コード例 #5
0
        public TypedElementOnSourceNode(ISourceNode source, string type, IStructureDefinitionSummaryProvider provider, TypedElementSettings settings = null)
        {
            if (source == null)
            {
                throw Error.ArgumentNull(nameof(source));
            }

            Provider  = provider ?? throw Error.ArgumentNull(nameof(provider));
            _settings = settings ?? new TypedElementSettings();

            if (source is IExceptionSource ies && ies.ExceptionHandler == null)
            {
                ies.ExceptionHandler = (o, a) => ExceptionHandler.NotifyOrThrow(o, a);
            }

            ShortPath = source.Name;
            _source   = source;
            (InstanceType, Definition) = buildRootPosition(type);
        }