Skip to content

Commit 6010947

Browse files
authored
Fix class name CoOrds (#544)
1 parent cf8281e commit 6010947

File tree

3 files changed

+45
-45
lines changed

3 files changed

+45
-45
lines changed

snippets/csharp/VS_Snippets_VBCSharp/csProgGuideObjects/CS/Objects.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ namespace CsCsrefProgrammingObjects
1010
// but as the framework already includes a POINT structure, this was troublesome
1111
//-----------------------------------------------------------------------------
1212
// 05/06/05 Per mblome
13-
// Yes, use CoOrds instead of Point everywhere
13+
// Yes, use Coords instead of Point everywhere
1414
//-----------------------------------------------------------------------------
1515

1616

1717
//-----------------------------------------------------------------------------
1818
//<Snippet1>
19-
public struct CoOrds
19+
public struct Coords
2020
{
2121
public int x, y;
2222

23-
public CoOrds(int p1, int p2)
23+
public Coords(int p1, int p2)
2424
{
2525
x = p1;
2626
y = p2;
@@ -32,19 +32,19 @@ public CoOrds(int p1, int p2)
3232
//-----------------------------------------------------------------------------
3333
//<Snippet2>
3434
// Declare and initialize struct objects.
35-
class TestCoOrds
35+
class TestCoords
3636
{
3737
static void Main()
3838
{
3939
// Initialize:
40-
CoOrds coords1 = new CoOrds();
41-
CoOrds coords2 = new CoOrds(10, 10);
40+
Coords coords1 = new Coords();
41+
Coords coords2 = new Coords(10, 10);
4242

4343
// Display results:
44-
Console.Write("CoOrds 1: ");
44+
Console.Write("Coords 1: ");
4545
Console.WriteLine("x = {0}, y = {1}", coords1.x, coords1.y);
4646

47-
Console.Write("CoOrds 2: ");
47+
Console.Write("Coords 2: ");
4848
Console.WriteLine("x = {0}, y = {1}", coords2.x, coords2.y);
4949

5050
// Keep the console window open in debug mode.
@@ -53,57 +53,57 @@ static void Main()
5353
}
5454
}
5555
/* Output:
56-
CoOrds 1: x = 0, y = 0
57-
CoOrds 2: x = 10, y = 10
56+
Coords 1: x = 0, y = 0
57+
Coords 2: x = 10, y = 10
5858
*/
5959
//</Snippet2>
6060

6161

6262
//-----------------------------------------------------------------------------
6363
//<Snippet3>
6464
// Declare a struct object without "new."
65-
class TestCoOrdsNoNew
65+
class TestCoordsNoNew
6666
{
6767
static void Main()
6868
{
6969
// Declare an object:
70-
CoOrds coords1;
70+
Coords coords1;
7171

7272
// Initialize:
7373
coords1.x = 10;
7474
coords1.y = 20;
7575

7676
// Display results:
77-
Console.Write("CoOrds 1: ");
77+
Console.Write("Coords 1: ");
7878
Console.WriteLine("x = {0}, y = {1}", coords1.x, coords1.y);
7979

8080
// Keep the console window open in debug mode.
8181
Console.WriteLine("Press any key to exit.");
8282
Console.ReadKey();
8383
}
8484
}
85-
// Output: CoOrds 1: x = 10, y = 20
85+
// Output: Coords 1: x = 10, y = 20
8686
//</Snippet3>
8787

8888

8989
//-----------------------------------------------------------------------------
90-
namespace WrapCoOrds
90+
namespace WrapCoords
9191
{
9292
//<Snippet4>
93-
class CoOrds
93+
class Coords
9494
{
9595
public int x, y;
9696

9797
// Default constructor:
98-
public CoOrds()
98+
public Coords()
9999
{
100100
x = 0;
101101
y = 0;
102102
}
103103

104104
//<Snippet76>
105105
// A constructor with two arguments:
106-
public CoOrds(int x, int y)
106+
public Coords(int x, int y)
107107
{
108108
this.x = x;
109109
this.y = y;
@@ -122,34 +122,34 @@ class MainClass
122122
static void Main()
123123
{
124124
//<Snippet77>
125-
CoOrds p1 = new CoOrds();
126-
CoOrds p2 = new CoOrds(5, 3);
125+
Coords p1 = new Coords();
126+
Coords p2 = new Coords(5, 3);
127127
//</Snippet77>
128128

129129
// Display the results using the overriden ToString method:
130-
Console.WriteLine("CoOrds #1 at {0}", p1);
131-
Console.WriteLine("CoOrds #2 at {0}", p2);
130+
Console.WriteLine("Coords #1 at {0}", p1);
131+
Console.WriteLine("Coords #2 at {0}", p2);
132132
Console.ReadKey();
133133
}
134134
}
135135
/* Output:
136-
CoOrds #1 at (0,0)
137-
CoOrds #2 at (5,3)
136+
Coords #1 at (0,0)
137+
Coords #2 at (5,3)
138138
*/
139139
//</Snippet4>
140140
}
141141

142142

143143
//-----------------------------------------------------------------------------
144-
namespace WrapCoOrdsDefaultConstructorOnly
144+
namespace WrapCoordsDefaultConstructorOnly
145145
{
146146
//<Snippet5>
147-
class CoOrds
147+
class Coords
148148
{
149149
public int x, y;
150150

151151
// constructor
152-
public CoOrds()
152+
public Coords()
153153
{
154154
x = 0;
155155
y = 0;
@@ -178,13 +178,13 @@ public Cylinder(double radius, double height)
178178
}
179179
//</Snippet6>
180180
}
181-
class CoOrds
181+
class Coords
182182
{
183-
public CoOrds(int x, int y)
183+
public Coords(int x, int y)
184184
{
185185
}
186186
//<Snippet7>
187-
public CoOrds()
187+
public Coords()
188188
: this(0, 20)
189189
{
190190
}
@@ -580,43 +580,43 @@ static void Main()
580580

581581

582582
//-----------------------------------------------------------------------------
583-
namespace WrapCoOrds2
583+
namespace WrapCoords2
584584
{
585585
//<Snippet17>
586-
public partial class CoOrds
586+
public partial class Coords
587587
{
588588
private int x;
589589
private int y;
590590

591-
public CoOrds(int x, int y)
591+
public Coords(int x, int y)
592592
{
593593
this.x = x;
594594
this.y = y;
595595
}
596596
}
597597

598-
public partial class CoOrds
598+
public partial class Coords
599599
{
600-
public void PrintCoOrds()
600+
public void PrintCoords()
601601
{
602-
Console.WriteLine("CoOrds: {0},{1}", x, y);
602+
Console.WriteLine("Coords: {0},{1}", x, y);
603603
}
604604

605605
}
606606

607-
class TestCoOrds
607+
class TestCoords
608608
{
609609
static void Main()
610610
{
611-
CoOrds myCoOrds = new CoOrds(10, 15);
612-
myCoOrds.PrintCoOrds();
611+
Coords myCoords = new Coords(10, 15);
612+
myCoords.PrintCoords();
613613

614614
// Keep the console window open in debug mode.
615615
Console.WriteLine("Press any key to exit.");
616616
Console.ReadKey();
617617
}
618618
}
619-
// Output: CoOrds: 10,15
619+
// Output: Coords: 10,15
620620
//</Snippet17>
621621
}
622622

snippets/csharp/VS_Snippets_VBCSharp/csProgGuidePointers/CS/Pointers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static void Main()
221221

222222

223223
//<Snippet10>
224-
struct CoOrds
224+
struct Coords
225225
{
226226
public int x;
227227
public int y;
@@ -231,11 +231,11 @@ class AccessMembers
231231
{
232232
static void Main()
233233
{
234-
CoOrds home;
234+
Coords home;
235235

236236
unsafe
237237
{
238-
CoOrds* p = &home;
238+
Coords* p = &home;
239239
p->x = 25;
240240
p->y = 12;
241241

snippets/csharp/concepts/structs/struct-keyword.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
public struct CoOrds
1+
public struct Coords
22
{
33
public int x, y;
44

5-
public CoOrds(int p1, int p2)
5+
public Coords(int p1, int p2)
66
{
77
x = p1;
88
y = p2;

0 commit comments

Comments
 (0)