Skip to content

Commit 328b3b9

Browse files
authored
add interactive notes (#3678)
1 parent c7128b8 commit 328b3b9

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

xml/System/TimeSpan.xml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,9 @@
465465
466466
## Examples
467467
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+
469471
[!code-csharp-interactive[System.TimeSpan.Add#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.add/cs/add1.cs#1)]
470472
[!code-vb[System.TimeSpan.Add#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.add/vb/add1.vb#1)]
471473
@@ -541,6 +543,8 @@
541543
## Examples
542544
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.
543545
546+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)]
547+
544548
[!code-csharp-interactive[System.TimeSpan.Compare#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.compare/cs/compare1.cs#1)]
545549
[!code-vb[System.TimeSpan.Compare#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.compare/vb/compare1.vb#1)]
546550
@@ -2079,7 +2083,9 @@
20792083
20802084
## Remarks
20812085
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+
20832089
[!code-csharp-interactive[System.TimeSpan.Operators#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.operators/cs/operators1.cs#1)]
20842090
[!code-vb[System.TimeSpan.Operators#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.operators/vb/operators1.vb#1)]
20852091
@@ -2669,7 +2675,9 @@
26692675
26702676
## Examples
26712677
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+
26732681
[!code-csharp-interactive[System.TimeSpan.Operators#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.operators/cs/Subtraction1.cs#2)]
26742682
[!code-vb[System.TimeSpan.Operators#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.operators/vb/Subtraction1.vb#2)]
26752683
@@ -2798,6 +2806,15 @@
27982806
</AssemblyInfo>
27992807
<Docs>
28002808
<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"><![CDATA[
2811+
2812+
## Remarks
2813+
2814+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)]
2815+
2816+
]]></format>
2817+
</remarks>
28012818
<altmember cref="Overload:System.TimeSpan.TryParse" />
28022819
</Docs>
28032820
</MemberGroup>
@@ -3608,6 +3625,8 @@ When a time interval component in the string to be parsed contains more than sev
36083625
## Examples
36093626
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.
36103627
3628+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)]
3629+
36113630
[!code-csharp-interactive[System.TimeSpan.Subtract#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.subtract/cs/subtract1.cs#1)]
36123631
36133632
]]></format>
@@ -4038,6 +4057,15 @@ This member is an explicit interface member implementation. It can be used only
40384057
</AssemblyInfo>
40394058
<Docs>
40404059
<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"><![CDATA[
4062+
4063+
## Remarks
4064+
4065+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)]
4066+
4067+
]]></format>
4068+
</remarks>
40414069
</Docs>
40424070
</MemberGroup>
40434071
<Member MemberName="ToString">
@@ -4318,7 +4346,9 @@ This member is an explicit interface member implementation. It can be used only
43184346
43194347
## Examples
43204348
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+
43224352
[!code-csharp-interactive[System.TimeSpan.TotalDays#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totaldays/cs/totaldays.cs#1)]
43234353
[!code-vb[System.TimeSpan.TotalDays#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totaldays/vb/totaldays.vb#1)]
43244354
@@ -4380,6 +4410,8 @@ This member is an explicit interface member implementation. It can be used only
43804410
## Examples
43814411
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.
43824412
4413+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)]
4414+
43834415
[!code-csharp-interactive[System.TimeSpan.TotalHours#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalhours/cs/totalhours.cs#1)]
43844416
[!code-vb[System.TimeSpan.TotalHours#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalhours/vb/totalhours.vb#1)]
43854417
@@ -4441,6 +4473,8 @@ This member is an explicit interface member implementation. It can be used only
44414473
## Examples
44424474
The following example instantiates a <xref:System.TimeSpan> object and displays the value of its <xref:System.TimeSpan.TotalMilliseconds%2A> property.
44434475
4476+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)]
4477+
44444478
[!code-csharp-interactive[System.TimeSpan.TotalMilliseconds#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalmilliseconds/cs/totalmilliseconds.cs#1)]
44454479
[!code-vb[System.TimeSpan.TotalMilliseconds#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalmilliseconds/vb/totalmilliseconds.vb#1)]
44464480
@@ -4501,7 +4535,9 @@ This member is an explicit interface member implementation. It can be used only
45014535
45024536
## Examples
45034537
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+
45054541
[!code-csharp-interactive[System.TimeSpan.TotalMinutes#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalminutes/cs/totalminutes.cs#1)]
45064542
[!code-vb[System.TimeSpan.TotalMinutes#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalminutes/vb/totalminutes.vb#1)]
45074543
@@ -4568,6 +4604,8 @@ This member is an explicit interface member implementation. It can be used only
45684604
## Examples
45694605
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.
45704606
4607+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note.md)]
4608+
45714609
[!code-csharp-interactive[System.TimeSpan.TotalSeconds#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.timespan.totalseconds/cs/totalseconds.cs#1)]
45724610
[!code-vb[System.TimeSpan.TotalSeconds#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.timespan.totalseconds/vb/totalseconds.vb#1)]
45734611
@@ -4630,6 +4668,15 @@ This member is an explicit interface member implementation. It can be used only
46304668
</AssemblyInfo>
46314669
<Docs>
46324670
<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"><![CDATA[
4673+
4674+
## Remarks
4675+
4676+
[!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)]
4677+
4678+
]]></format>
4679+
</remarks>
46334680
<altmember cref="Overload:System.TimeSpan.Parse" />
46344681
</Docs>
46354682
</MemberGroup>

0 commit comments

Comments
 (0)