Esempio n. 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()));
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 11, Configuration.FieldSeparator),
                       Id,
                       SetId.HasValue ? SetId.Value.ToString(culture) : null,
                       AccessRestrictionActionCode?.ToDelimitedString(),
                       AccessRestrictionValue?.ToDelimitedString(),
                       AccessRestrictionReason != null ? string.Join(Configuration.FieldRepeatSeparator, AccessRestrictionReason.Select(x => x.ToDelimitedString())) : null,
                       SpecialAccessRestrictionInstructions != null ? string.Join(Configuration.FieldRepeatSeparator, SpecialAccessRestrictionInstructions) : null,
                       AccessRestrictionDateRange?.ToDelimitedString(),
                       SecurityClassificationTag?.ToDelimitedString(),
                       SecurityHandlingInstructions != null ? string.Join(Configuration.FieldRepeatSeparator, SecurityHandlingInstructions.Select(x => x.ToDelimitedString())) : null,
                       AccessRestrictionMessageLocation != null ? string.Join(Configuration.FieldRepeatSeparator, AccessRestrictionMessageLocation.Select(x => x.ToDelimitedString())) : null,
                       AccessRestrictionInstanceIdentifier?.ToDelimitedString()
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Esempio n. 3
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       $"{{0}}{{1}}{ StringHelper.StringFormatSequence(2, 27, Configuration.FieldSeparator) }",
                       Id,
                       FieldSeparator,
                       EncodingCharacters,
                       SendingApplication?.ToDelimitedString(),
                       SendingFacility?.ToDelimitedString(),
                       ReceivingApplication?.ToDelimitedString(),
                       ReceivingFacility != null ? string.Join(Configuration.FieldRepeatSeparator, ReceivingFacility.Select(x => x.ToDelimitedString())) : null,
                       DateTimeOfMessage.HasValue ? DateTimeOfMessage.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       Security,
                       MessageType?.ToDelimitedString(),
                       MessageControlId,
                       ProcessingId?.ToDelimitedString(),
                       VersionId?.ToDelimitedString(),
                       SequenceNumber.HasValue ? SequenceNumber.Value.ToString(Consts.NumericFormat, culture) : null,
                       ContinuationPointer,
                       AcceptAcknowledgmentType,
                       ApplicationAcknowledgmentType,
                       CountryCode,
                       CharacterSet != null ? string.Join(Configuration.FieldRepeatSeparator, CharacterSet) : null,
                       PrincipalLanguageOfMessage?.ToDelimitedString(),
                       AlternateCharacterSetHandlingScheme,
                       MessageProfileIdentifier != null ? string.Join(Configuration.FieldRepeatSeparator, MessageProfileIdentifier.Select(x => x.ToDelimitedString())) : null,
                       SendingResponsibleOrganization?.ToDelimitedString(),
                       ReceivingResponsibleOrganization?.ToDelimitedString(),
                       SendingNetworkAddress?.ToDelimitedString(),
                       ReceivingNetworkAddress?.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()));
        }