|
465 | 465 |
|
466 | 466 | ## Examples
|
467 | 467 | The following example calls the <xref:System.TimeSpan.Add%2A> method to add each element in an array of time intervals to a base <xref:System.TimeSpan> value.
|
468 |
| - |
| 468 | +
|
| 469 | +[!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 470 | +
|
469 | 471 | [!code-csharp-interactive[System.TimeSpan.Add#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.add/cs/add1.cs#1)]
|
470 | 472 | [!code-vb[System.TimeSpan.Add#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.add/vb/add1.vb#1)]
|
471 | 473 |
|
|
541 | 543 | ## Examples
|
542 | 544 | The following example uses the <xref:System.TimeSpan.Compare%2A> method to compare several <xref:System.TimeSpan> objects with a <xref:System.TimeSpan> object whose value is a 2-hour time interval.
|
543 | 545 |
|
| 546 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 547 | +
|
544 | 548 | [!code-csharp-interactive[System.TimeSpan.Compare#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.compare/cs/compare1.cs#1)]
|
545 | 549 | [!code-vb[System.TimeSpan.Compare#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.compare/vb/compare1.vb#1)]
|
546 | 550 |
|
|
2079 | 2083 |
|
2080 | 2084 | ## Remarks
|
2081 | 2085 | The <xref:System.TimeSpan.op_Addition%2A> method defines the addition operator for <xref:System.TimeSpan> values. It enables code such as the following:
|
2082 |
| - |
| 2086 | +
|
| 2087 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 2088 | +
|
2083 | 2089 | [!code-csharp-interactive[System.TimeSpan.Operators#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.operators/cs/operators1.cs#1)]
|
2084 | 2090 | [!code-vb[System.TimeSpan.Operators#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.operators/vb/operators1.vb#1)]
|
2085 | 2091 |
|
|
2669 | 2675 |
|
2670 | 2676 | ## Examples
|
2671 | 2677 | The following example uses the <xref:System.TimeSpan> subtraction operator to calculate the total length of the weekly work day. It also uses the <xref:System.TimeSpan> addition operator to compute the total time of the daily breaks before using it in a subtraction operation to compute the total actual daily working time.
|
2672 |
| - |
| 2678 | +
|
| 2679 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 2680 | +
|
2673 | 2681 | [!code-csharp-interactive[System.TimeSpan.Operators#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.operators/cs/Subtraction1.cs#2)]
|
2674 | 2682 | [!code-vb[System.TimeSpan.Operators#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.operators/vb/Subtraction1.vb#2)]
|
2675 | 2683 |
|
|
2798 | 2806 | </AssemblyInfo>
|
2799 | 2807 | <Docs>
|
2800 | 2808 | <summary>Converts the string representation of a time interval to its <see cref="T:System.TimeSpan" /> equivalent.</summary>
|
| 2809 | + <remarks> |
| 2810 | + <format type="text/markdown"><] |
| 2815 | +
|
| 2816 | + ]]></format> |
| 2817 | + </remarks> |
2801 | 2818 | <altmember cref="Overload:System.TimeSpan.TryParse" />
|
2802 | 2819 | </Docs>
|
2803 | 2820 | </MemberGroup>
|
@@ -3608,6 +3625,8 @@ When a time interval component in the string to be parsed contains more than sev
|
3608 | 3625 | ## Examples
|
3609 | 3626 | The following example uses the <xref:System.TimeSpan.Subtract%2A> method to calculate the difference between a single <xref:System.TimeSpan> value and each of the time intervals in an array. Note that, because <xref:System.TimeSpan> format strings do not include negative signs in the result string, the example uses conditional logic to include a negative sign with negative time intervals.
|
3610 | 3627 |
|
| 3628 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 3629 | +
|
3611 | 3630 | [!code-csharp-interactive[System.TimeSpan.Subtract#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.subtract/cs/subtract1.cs#1)]
|
3612 | 3631 |
|
3613 | 3632 | ]]></format>
|
@@ -4038,6 +4057,15 @@ This member is an explicit interface member implementation. It can be used only
|
4038 | 4057 | </AssemblyInfo>
|
4039 | 4058 | <Docs>
|
4040 | 4059 | <summary>Converts the value of the current <see cref="T:System.TimeSpan" /> object to its equivalent string representation.</summary>
|
| 4060 | + <remarks> |
| 4061 | + <format type="text/markdown"><] |
| 4066 | +
|
| 4067 | + ]]></format> |
| 4068 | + </remarks> |
4041 | 4069 | </Docs>
|
4042 | 4070 | </MemberGroup>
|
4043 | 4071 | <Member MemberName="ToString">
|
@@ -4318,7 +4346,9 @@ This member is an explicit interface member implementation. It can be used only
|
4318 | 4346 |
|
4319 | 4347 | ## Examples
|
4320 | 4348 | The following example instantiates a <xref:System.TimeSpan> object and displays the value of its <xref:System.TimeSpan.TotalDays%2A> property. It also displays the value of each component (hours, minutes, seconds, milliseconds) that forms the fractional part of the value of its <xref:System.TimeSpan.TotalDays%2A> property.
|
4321 |
| - |
| 4349 | + |
| 4350 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 4351 | +
|
4322 | 4352 | [!code-csharp-interactive[System.TimeSpan.TotalDays#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totaldays/cs/totaldays.cs#1)]
|
4323 | 4353 | [!code-vb[System.TimeSpan.TotalDays#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totaldays/vb/totaldays.vb#1)]
|
4324 | 4354 |
|
@@ -4380,6 +4410,8 @@ This member is an explicit interface member implementation. It can be used only
|
4380 | 4410 | ## Examples
|
4381 | 4411 | The following example instantiates a <xref:System.TimeSpan> object and displays the value its <xref:System.TimeSpan.TotalHours%2A> property. It also displays the value of each component (hours, minutes, seconds, and milliseconds) that forms the fractional part of the value of its <xref:System.TimeSpan.TotalHours%2A> property.
|
4382 | 4412 |
|
| 4413 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 4414 | +
|
4383 | 4415 | [!code-csharp-interactive[System.TimeSpan.TotalHours#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalhours/cs/totalhours.cs#1)]
|
4384 | 4416 | [!code-vb[System.TimeSpan.TotalHours#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalhours/vb/totalhours.vb#1)]
|
4385 | 4417 |
|
@@ -4441,6 +4473,8 @@ This member is an explicit interface member implementation. It can be used only
|
4441 | 4473 | ## Examples
|
4442 | 4474 | The following example instantiates a <xref:System.TimeSpan> object and displays the value of its <xref:System.TimeSpan.TotalMilliseconds%2A> property.
|
4443 | 4475 |
|
| 4476 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 4477 | +
|
4444 | 4478 | [!code-csharp-interactive[System.TimeSpan.TotalMilliseconds#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalmilliseconds/cs/totalmilliseconds.cs#1)]
|
4445 | 4479 | [!code-vb[System.TimeSpan.TotalMilliseconds#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalmilliseconds/vb/totalmilliseconds.vb#1)]
|
4446 | 4480 |
|
@@ -4501,7 +4535,9 @@ This member is an explicit interface member implementation. It can be used only
|
4501 | 4535 |
|
4502 | 4536 | ## Examples
|
4503 | 4537 | The following example instantiates a <xref:System.TimeSpan> object and displays the value of its <xref:System.TimeSpan.TotalMinutes%2A> property. It also displays the value of each component (seconds, milliseconds) that forms the fractional part of the value of its <xref:System.TimeSpan.TotalMinutes%2A> property.
|
4504 |
| - |
| 4538 | + |
| 4539 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 4540 | +
|
4505 | 4541 | [!code-csharp-interactive[System.TimeSpan.TotalMinutes#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalminutes/cs/totalminutes.cs#1)]
|
4506 | 4542 | [!code-vb[System.TimeSpan.TotalMinutes#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalminutes/vb/totalminutes.vb#1)]
|
4507 | 4543 |
|
@@ -4568,6 +4604,8 @@ This member is an explicit interface member implementation. It can be used only
|
4568 | 4604 | ## Examples
|
4569 | 4605 | The following example instantiates a <xref:System.TimeSpan> object and displays the value of its <xref:System.TimeSpan.TotalSeconds%2A> property. It also displays the value of its milliseconds component, which forms the fractional part of the value of its <xref:System.TimeSpan.TotalSeconds%2A> property.
|
4570 | 4606 |
|
| 4607 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)] |
| 4608 | +
|
4571 | 4609 | [!code-csharp-interactive[System.TimeSpan.TotalSeconds#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalseconds/cs/totalseconds.cs#1)]
|
4572 | 4610 | [!code-vb[System.TimeSpan.TotalSeconds#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalseconds/vb/totalseconds.vb#1)]
|
4573 | 4611 |
|
@@ -4630,6 +4668,15 @@ This member is an explicit interface member implementation. It can be used only
|
4630 | 4668 | </AssemblyInfo>
|
4631 | 4669 | <Docs>
|
4632 | 4670 | <summary>Converts the specified string representation of a time interval to its <see cref="T:System.TimeSpan" /> equivalent and returns a value that indicates whether the conversion succeeded.</summary>
|
| 4671 | + <remarks> |
| 4672 | + <format type="text/markdown"><] |
| 4677 | +
|
| 4678 | + ]]></format> |
| 4679 | + </remarks> |
4633 | 4680 | <altmember cref="Overload:System.TimeSpan.Parse" />
|
4634 | 4681 | </Docs>
|
4635 | 4682 | </MemberGroup>
|
|
0 commit comments