示例#1
0
        /// <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)
        {
            var result = string.Empty;

            result += $"JobName:            {JobName} {Environment.NewLine}";
            result += $"BaseName:           {BaseName} {Environment.NewLine}";
            result += $"InputFile:          {InputFile} {Environment.NewLine}";
            result += $"InputType:          {Input} {Environment.NewLine}";
            result += $"OutputFile:         {OutputFile} {Environment.NewLine}";
            result += Environment.NewLine;

            result += $"AudioStreams:       {Environment.NewLine}";
            result  = AudioStreams.Aggregate(result, (current, item) => current + $"{item} {Environment.NewLine}");
            result += Environment.NewLine;

            result += $"SubtitleStreams:    {Environment.NewLine}";
            result  = SubtitleStreams.Aggregate(result, (current, item) => current + $"{item} {Environment.NewLine}");
            result += Environment.NewLine;

            var list = new List <string>();

            foreach (var item in Chapters)
            {
                var dt = DateTime.MinValue.Add(item);
                list.Add(dt.ToString("H:mm:ss.fff"));
            }
            result += $"Chapters:           {string.Join(",", list.ToArray())} {Environment.NewLine}";

            result += $"NextStep:           {NextStep} {Environment.NewLine}";
            result += $"CompletedStep:      {CompletedStep} {Environment.NewLine}";
            result += Environment.NewLine;

            result += $"VideoStream:        {Environment.NewLine}";
            result += $"{VideoStream} {Environment.NewLine}";
            result += Environment.NewLine;

            result += $"StreamID:           {StreamId:0} {Environment.NewLine}";
            result += $"TrackID:            {TrackId:0} {Environment.NewLine}";

            result += $"TempInput:          {TempInput} {Environment.NewLine}";
            result += $"TempOutput:         {TempOutput} {Environment.NewLine}";
            result += $"DumpOutput:         {DumpOutput} {Environment.NewLine}";
            result += $"SelectedDVDChapters:{SelectedDvdChapters} {Environment.NewLine}";
            result += $"TempFiles:          {string.Join(",", TempFiles.ToArray())} {Environment.NewLine}";
            result += $"ReturnValue:        {ExitCode:0} {Environment.NewLine}";

            return(result);
        }
示例#2
0
        /// <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);
        }