コード例 #1
0
        /// <inheritdoc/>
        public void FromDelimitedString(string delimitedString, Separators separators)
        {
            Separators seps = separators ?? new Separators().UsingConfigurationValues();

            string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator;
            string[] segments  = delimitedString == null
                ? Array.Empty <string>()
                : delimitedString.Split(separator, StringSplitOptions.None);

            IdNumber   = segments.Length > 0 && segments[0].Length > 0 ? segments[0].ToNullableDecimal() : null;
            CheckDigit = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null;
            CodeIdentifyingTheCheckDigitSchemeEmployed = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null;
            AssigningAuthority = segments.Length > 3 && segments[3].Length > 0 ? TypeSerializer.Deserialize <HierarchicDesignator>(segments[3], true, seps) : null;
        }
コード例 #2
0
        /// <inheritdoc/>
        public void FromDelimitedString(string delimitedString, Separators separators)
        {
            Separators seps = separators ?? new Separators().UsingConfigurationValues();

            string[] separator = IsSubcomponent ? seps.SubcomponentSeparator : seps.ComponentSeparator;
            string[] segments  = delimitedString == null
                ? Array.Empty <string>()
                : delimitedString.Split(separator, StringSplitOptions.None);

            IdNumber   = segments.Length > 0 && segments[0].Length > 0 ? segments[0] : null;
            FamilyName = segments.Length > 1 && segments[1].Length > 0 ? segments[1] : null;
            GivenName  = segments.Length > 2 && segments[2].Length > 0 ? segments[2] : null;
            SecondAndFurtherGivenNamesOrInitialsThereof = segments.Length > 3 && segments[3].Length > 0 ? segments[3] : null;
            Suffix             = segments.Length > 4 && segments[4].Length > 0 ? segments[4] : null;
            Prefix             = segments.Length > 5 && segments[5].Length > 0 ? segments[5] : null;
            Degree             = segments.Length > 6 && segments[6].Length > 0 ? segments[6] : null;
            SourceTable        = segments.Length > 7 && segments[7].Length > 0 ? segments[7] : null;
            AssigningAuthority = segments.Length > 8 && segments[8].Length > 0 ? TypeSerializer.Deserialize <HierarchicDesignator>(segments[8], true, seps) : null;
        }