ClearCanvas.Dicom.DicomFragmentSequence.Dump C# (CSharp) Method

Dump() public method

Method for dumping the contents of the attribute to a string.
public Dump ( StringBuilder sb, string prefix, DicomDumpOptions options ) : void
sb StringBuilder The StringBuilder to write the attribute to.
prefix string A prefix to place before the value.
options DicomDumpOptions The to use for the output string.
return void
		public override void Dump(StringBuilder sb, string prefix, DicomDumpOptions options)
		{
			int ValueWidth = 40 - prefix.Length;
			int SbLength = sb.Length;

			sb.Append(prefix);
			sb.AppendFormat("({0:x4},{1:x4}) {2} ", Tag.Group, Tag.Element, Tag.VR.Name);
			long length = 0;
			foreach (DicomFragment frag in Fragments)
			{
				length += frag.Length;
			}

			String value = string.Format("{0} encapsulated fragment{1} of {2} bytes", Fragments.Count, Fragments.Count > 1 ? "s" : "", length);
			sb.Append(value.PadRight(ValueWidth, ' '));

			sb.AppendFormat(" # {0,4} {2} {1}", StreamLength, Tag.VM, Tag.Name.Replace("'", "'"));

			if (Flags.IsSet(options, DicomDumpOptions.Restrict80CharactersPerLine))
			{
				if (sb.Length > (SbLength + 79))
				{
					sb.Length = SbLength + 79;
					//sb.Append(">");
				}
			}
		}