public override string ToString() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("progress:{"); for (int i = 0; i < StepProgresss.Count; ++i) { sb.Append(string.Format("[{0}]:{1}", i, StepProgresss[i].ToString())); } sb.Append("}"); if (FirstStep != null) { sb.Append(",first_step:{"); sb.Append(FirstStep.ToString()); sb.Append("}"); } if (NextStep != null) { sb.Append(",next_step:{"); sb.Append(NextStep.ToString()); sb.Append("}"); } return(sb.ToString()); }
/// <summary> /// Formatiert den Wert der aktuellen Instanz unter Verwendung des angegebenen Formats. /// </summary> /// <returns> /// Der Wert der aktuellen Instanz im angegebenen Format. /// </returns> /// <param name="format">Das zu verwendende Format.– oder – Ein NULL-Verweis (Nothing in Visual Basic), /// wenn das für den Typ der <see cref="T:System.IFormattable"/> -Implementierung definierte Standardformat verwendet werden soll. </param> /// <param name="formatProvider">Der zum Formatieren des Werts zu verwendende Anbieter.– oder – Ein NULL-Verweis (Nothing in Visual Basic), /// wenn die Informationen über numerische Formate dem aktuellen Gebietsschema des Betriebssystems entnommen werden sollen. </param> /// <filterpriority>2</filterpriority> public string ToString(string format, IFormatProvider formatProvider) { string result = string.Empty; result += string.Format(AppSettings.CInfo, "JobName: {0:s} {1:s}", JobName, Environment.NewLine); result += string.Format(AppSettings.CInfo, "BaseName: {0:s} {1:s}", BaseName, Environment.NewLine); result += string.Format(AppSettings.CInfo, "InputFile: {0:s} {1:s}", InputFile, Environment.NewLine); result += string.Format(AppSettings.CInfo, "InputType: {0:s} {1:s}", Input.ToString(), Environment.NewLine); result += string.Format(AppSettings.CInfo, "OutputFile: {0:s} {1:s}", OutputFile, Environment.NewLine); result += Environment.NewLine; result += string.Format(AppSettings.CInfo, "AudioStreams: {0:s}", Environment.NewLine); result = AudioStreams.Aggregate(result, (current, item) => current + string.Format(AppSettings.CInfo, "{0:s} {1:s}", item, Environment.NewLine)); result += Environment.NewLine; result += string.Format(AppSettings.CInfo, "SubtitleStreams: {0:s}", Environment.NewLine); result = SubtitleStreams.Aggregate(result, (current, item) => current + string.Format(AppSettings.CInfo, "{0:s} {1:s}", item, Environment.NewLine)); result += Environment.NewLine; result += string.Format(AppSettings.CInfo, "Chapters: {0:s} {1:s}", string.Join(",", (from item in Chapters let dt = new DateTime() select DateTime.MinValue.Add(item) into dt select dt.ToString("H:mm:ss.fff")).ToArray()), Environment.NewLine); result += string.Format(AppSettings.CInfo, "NextStep: {0:s} {1:s}", NextStep.ToString(), Environment.NewLine); result += string.Format(AppSettings.CInfo, "CompletedStep: {0:s} {1:s}", CompletedStep.ToString(), Environment.NewLine); result += Environment.NewLine; result += string.Format(AppSettings.CInfo, "VideoStream: {0:s}", Environment.NewLine); result += string.Format(AppSettings.CInfo, "{0:s} {1:s}", VideoStream, Environment.NewLine); result += Environment.NewLine; result += string.Format(AppSettings.CInfo, "StreamID: {0:g} {1:s}", StreamId, Environment.NewLine); result += string.Format(AppSettings.CInfo, "TrackID: {0:g} {1:s}", TrackId, Environment.NewLine); result += string.Format(AppSettings.CInfo, "TempInput: {0:s} {1:s}", TempInput, Environment.NewLine); result += string.Format(AppSettings.CInfo, "TempOutput: {0:s} {1:s}", TempOutput, Environment.NewLine); result += string.Format(AppSettings.CInfo, "DumpOutput: {0:s} {1:s}", DumpOutput, Environment.NewLine); result += string.Format(AppSettings.CInfo, "SelectedDVDChapters:{0:s} {1:s}", SelectedDvdChapters, Environment.NewLine); result += string.Format(AppSettings.CInfo, "TempFiles: {0:s} {1:s}", string.Join(",", TempFiles.ToArray()), Environment.NewLine); result += string.Format(AppSettings.CInfo, "ReturnValue: {0:g} {1:s}", ExitCode, Environment.NewLine); return(result); }