Skip to content

Commit 4927017

Browse files
authored
Batch 20 - sample improvements (#4756)
1 parent e04a98c commit 4927017

File tree

10 files changed

+68
-71
lines changed

10 files changed

+68
-71
lines changed

samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace Example
8181

8282
Console::WriteLine( "The path of this Uri is {0}", uriAddress->GetLeftPart( UriPartial::Path ) );
8383
Console::WriteLine( "Hash code {0}", uriAddress->GetHashCode() );
84-
// The example displays the following output:
84+
// The example displays output similar to the following:
8585
// #search
8686
// Uri uses the default port
8787
// The path of this Uri is http://www.contoso.com/index.htm

samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CS/source.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
public class Form1: Form
77
{
8-
protected void Method()
9-
{
10-
// <Snippet1>
11-
Uri baseUri = new Uri("http://www.contoso.com/");
12-
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
8+
protected void Method()
9+
{
10+
// <Snippet1>
11+
Uri baseUri = new Uri("http://www.contoso.com/");
12+
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
1313

14-
Console.WriteLine(myUri.AbsolutePath);
14+
Console.WriteLine(myUri.AbsolutePath);
1515

16-
// </Snippet1>
17-
}
18-
}
16+
// </Snippet1>
17+
}
18+
}

samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsoluteUri Example/CS/source.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55

66
public class Form1: Form
77
{
8-
protected void Method()
9-
{
10-
// <Snippet1>
11-
Uri baseUri= new Uri("http://www.contoso.com");
12-
Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today");
13-
Console.WriteLine(myUri.AbsoluteUri);
14-
15-
// </Snippet1>
16-
}
17-
}
8+
protected void Method()
9+
{
10+
// <Snippet1>
11+
Uri baseUri= new Uri("http://www.contoso.com");
12+
Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today");
13+
Console.WriteLine(myUri.AbsoluteUri);
14+
// </Snippet1>
15+
}
16+
}

samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Host Example/CS/source.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
public class Form1: Form
77
{
8-
protected void Method()
9-
{
10-
// <Snippet1>
11-
Uri baseUri = new Uri("http://www.contoso.com:8080/");
12-
Uri myUri = new Uri(baseUri, "shownew.htm?date=today");
8+
protected void Method()
9+
{
10+
// <Snippet1>
11+
Uri baseUri = new Uri("http://www.contoso.com:8080/");
12+
Uri myUri = new Uri(baseUri, "shownew.htm?date=today");
1313

14-
Console.WriteLine(myUri.Host);
15-
16-
// </Snippet1>
17-
}
18-
}
14+
Console.WriteLine(myUri.Host);
15+
// </Snippet1>
16+
}
17+
}

samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55

66
public class Form1: Form
77
{
8-
protected void Method()
9-
{
10-
// <Snippet1>
11-
Uri baseUri = new Uri("http://www.contoso.com/");
12-
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
8+
protected void Method()
9+
{
10+
// <Snippet1>
11+
Uri baseUri = new Uri("http://www.contoso.com/");
12+
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
1313

14-
Console.WriteLine(myUri.PathAndQuery);
15-
// </Snippet1>
16-
}
14+
Console.WriteLine(myUri.PathAndQuery);
15+
// </Snippet1>
16+
}
1717

18-
public void Method2()
19-
{
18+
public void Method2()
19+
{
2020

21-
// <Snippet2>
22-
Uri baseUri = new Uri ("http://www.contoso.com/");
23-
Uri myUri = new Uri (baseUri, "catalog/shownew.htm?date=today");
21+
// <Snippet2>
22+
Uri baseUri = new Uri ("http://www.contoso.com/");
23+
Uri myUri = new Uri (baseUri, "catalog/shownew.htm?date=today");
2424

25-
Console.WriteLine (myUri.Query);
26-
// </Snippet2>
27-
}
28-
}
25+
Console.WriteLine (myUri.Query);
26+
// </Snippet2>
27+
}
28+
}

samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
public class Form1: Form
77
{
8-
protected void Method()
9-
{
10-
// <Snippet1>
11-
Uri baseUri = new Uri("http://www.contoso.com/");
12-
Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today");
8+
protected void Method()
9+
{
10+
// <Snippet1>
11+
Uri baseUri = new Uri("http://www.contoso.com/");
12+
Uri myUri = new Uri(baseUri,"catalog/shownew.htm?date=today");
1313

14-
Console.WriteLine(myUri.Port);
14+
Console.WriteLine(myUri.Port);
1515

16-
// </Snippet1>
17-
}
18-
}
16+
// </Snippet1>
17+
}
18+
}

samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Scheme Example/CS/source.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
public class Form1: Form
77
{
8-
protected void Method()
9-
{
10-
// <Snippet1>
11-
Uri baseUri = new Uri("http://www.contoso.com/");
12-
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
8+
protected void Method()
9+
{
10+
// <Snippet1>
11+
Uri baseUri = new Uri("http://www.contoso.com/");
12+
Uri myUri = new Uri(baseUri, "catalog/shownew.htm?date=today");
1313

14-
Console.WriteLine(myUri.Scheme);
15-
16-
// </Snippet1>
17-
}
18-
}
14+
Console.WriteLine(myUri.Scheme);
15+
// </Snippet1>
16+
}
17+
}

samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private static void GetParts()
7878

7979
Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path));
8080
Console.WriteLine("Hash code {0}", uriAddress.GetHashCode());
81-
// The example displays the following output:
81+
// The example displays output similar to the following:
8282
// #search
8383
// Uri uses the default port
8484
// The path of this Uri is http://www.contoso.com/index.htm

samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Public Class Test
7575

7676
Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path))
7777
Console.WriteLine("Hash code {0}", uriAddress.GetHashCode())
78-
' The example displays the following output:
78+
' The example displays output similar to the following:
7979
' #search
8080
' Uri uses the default port
8181
' The path of this Uri is http://www.contoso.com/index.htm

xml/System/Uri.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ The URI formed by combining <paramref name="baseUri" /> and <paramref name="rela
11121112
The path information does not include the scheme, host name, or query portion of the URI.
11131113
11141114
## Examples
1115-
The following example writes the path /catalog/shownew.htm to the console.
1115+
The following example writes the path `/catalog/shownew.htm` to the console.
11161116
11171117
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CPP/source.cpp" id="Snippet1":::
11181118
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.AbsolutePath Example/CS/source.cs" interactive="try-dotnet-method" id="Snippet1":::
@@ -3774,7 +3774,7 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
37743774
For more information on IRI support, see the Remarks section for the <xref:System.Uri> class.
37753775
37763776
## Examples
3777-
The following example writes the URI path (/catalog/shownew.htm) and query (date= today) information to the console.
3777+
The following example writes the URI path (`/catalog/shownew.htm`) and query (`?date=today`) information to the console.
37783778
37793779
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CPP/source.cpp" id="Snippet1":::
37803780
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs" interactive="try-dotnet-method" id="Snippet1":::
@@ -3888,7 +3888,7 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
38883888
For more information on IRI support, see the Remarks section for the <xref:System.Uri> class.
38893889
38903890
## Examples
3891-
The following example writes the query ?date= today to the console.
3891+
The following example writes the query `?date=today` to the console.
38923892
38933893
:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CPP/source.cpp" id="Snippet2":::
38943894
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.PathAndQuery Example/CS/source.cs" interactive="try-dotnet-method" id="Snippet2":::

0 commit comments

Comments
 (0)