Пример #1
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 18, Configuration.FieldSeparator),
                       Id,
                       FileFieldSeparator,
                       FileEncodingCharacters,
                       FileSendingApplication?.ToDelimitedString(),
                       FileSendingFacility?.ToDelimitedString(),
                       FileReceivingApplication?.ToDelimitedString(),
                       FileReceivingFacility?.ToDelimitedString(),
                       FileCreationDateTime.HasValue ? FileCreationDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       FileSecurity,
                       FileNameId,
                       FileHeaderComment,
                       FileControlId,
                       ReferenceFileControlId,
                       FileSendingNetworkAddress?.ToDelimitedString(),
                       FileReceivingNetworkAddress?.ToDelimitedString(),
                       SecurityClassificationTag?.ToDelimitedString(),
                       SecurityHandlingInstructions != null ? string.Join(Configuration.FieldRepeatSeparator, SecurityHandlingInstructions.Select(x => x.ToDelimitedString())) : null,
                       SpecialAccessRestrictionInstructions != null ? string.Join(Configuration.FieldRepeatSeparator, SpecialAccessRestrictionInstructions) : null
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Пример #2
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 13, Configuration.FieldSeparator),
                       Id,
                       FileFieldSeparator,
                       FileEncodingCharacters,
                       FileSendingApplication?.ToDelimitedString(),
                       FileSendingFacility?.ToDelimitedString(),
                       FileReceivingApplication?.ToDelimitedString(),
                       FileReceivingFacility?.ToDelimitedString(),
                       FileCreationDateTime.HasValue ? FileCreationDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       FileSecurity,
                       FileNameId,
                       FileHeaderComment,
                       FileControlId,
                       ReferenceFileControlId
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }