diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CS/nocb_basegetall.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CS/nocb_basegetall.cs index 64f7e81f99f..0f9f1d13d27 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CS/nocb_basegetall.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseGetAll/CS/nocb_basegetall.cs @@ -1,4 +1,4 @@ -// The following example uses BaseGetAllKeys and BaseGetAllValues to get an array of the keys or an array of the values. +// The following example uses BaseGetAllKeys and BaseGetAllValues to get an array of the keys or an array of the values. // For an expanded version of this example, see the NameObjectCollectionBase class topic. // @@ -22,11 +22,11 @@ public DictionaryEntry this[ int index ] { // Adds elements from an IDictionary into the new collection. public MyCollection( IDictionary d ) { foreach ( DictionaryEntry de in d ) { - this.BaseAdd( (String) de.Key, de.Value ); + this.BaseAdd( (string) de.Key, de.Value ); } } - // Gets a String array that contains all the keys in the collection. + // Gets a string array that contains all the keys in the collection. public String[] AllKeys { get { return( this.BaseGetAllKeys() ); @@ -40,7 +40,7 @@ public Array AllValues { } } - // Gets a String array that contains all the values in the collection. + // Gets a string array that contains all the values in the collection. public String[] AllStringValues { get { return( (String[]) this.BaseGetAllValues( typeof(System.String) ) ); @@ -63,7 +63,7 @@ public static void Main() { // Displays the list of keys. Console.WriteLine( "The list of keys:" ); - foreach ( String s in myCol.AllKeys ) { + foreach ( string s in myCol.AllKeys ) { Console.WriteLine( " {0}", s ); } @@ -73,9 +73,9 @@ public static void Main() { Console.WriteLine( " {0}", o.ToString() ); } - // Displays the list of values of type String. - Console.WriteLine( "The list of values (String):" ); - foreach ( String s in myCol.AllValues ) { + // Displays the list of values of type string. + Console.WriteLine( "The list of values (string):" ); + foreach ( string s in myCol.AllValues ) { Console.WriteLine( " {0}", s ); } } @@ -103,7 +103,7 @@ The list of values (Object): apple banana pear -The list of values (String): +The list of values (string): apple banana pear diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/CS/nocb_basehaskeys.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/CS/nocb_basehaskeys.cs index 023943672a0..b3da7768d7f 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/CS/nocb_basehaskeys.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseHasKeys/CS/nocb_basehaskeys.cs @@ -1,4 +1,4 @@ -// The following example uses BaseHasKeys to determine if the collection contains keys that are not a null reference. +// The following example uses BaseHasKeys to determine if the collection contains keys that are not a null reference. // For an expanded version of this example, see the NameObjectCollectionBase class topic. // @@ -24,7 +24,7 @@ public MyCollection() { } // Adds an entry to the collection. - public void Add( String key, Object value ) { + public void Add( string key, Object value ) { this.BaseAdd( key, value ); } diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CS/nocb_baseremove.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CS/nocb_baseremove.cs index 70fd6e2ae3f..ae00ea0fb16 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CS/nocb_baseremove.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseRemove/CS/nocb_baseremove.cs @@ -1,4 +1,4 @@ -// The following example uses BaseRemove and BaseRemoveAt to remove elements from a NameObjectCollectionBase. +// The following example uses BaseRemove and BaseRemoveAt to remove elements from a NameObjectCollectionBase. // For an expanded version of this example, see the NameObjectCollectionBase class topic. // @@ -22,12 +22,12 @@ public DictionaryEntry this[ int index ] { // Adds elements from an IDictionary into the new collection. public MyCollection( IDictionary d ) { foreach ( DictionaryEntry de in d ) { - this.BaseAdd( (String) de.Key, de.Value ); + this.BaseAdd( (string) de.Key, de.Value ); } } // Removes an entry with the specified key from the collection. - public void Remove( String key ) { + public void Remove( string key ) { this.BaseRemove( key ); } diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CS/nocb_baseset.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CS/nocb_baseset.cs index 7a994edbc3d..7534cdd367a 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CS/nocb_baseset.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.BaseSet/CS/nocb_baseset.cs @@ -1,4 +1,4 @@ -// The following example uses BaseSet to set the value of a specific element. +// The following example uses BaseSet to set the value of a specific element. // For an expanded version of this example, see the NameObjectCollectionBase class topic. // @@ -19,7 +19,7 @@ public Object this[ int index ] { } // Gets or sets the value associated with the specified key. - public Object this[ String key ] { + public Object this[ string key ] { get { return( this.BaseGet( key ) ); } @@ -28,7 +28,7 @@ public Object this[ String key ] { } } - // Gets a String array that contains all the keys in the collection. + // Gets a string array that contains all the keys in the collection. public String[] AllKeys { get { return( this.BaseGetAllKeys() ); @@ -38,7 +38,7 @@ public String[] AllKeys { // Adds elements from an IDictionary into the new collection. public MyCollection( IDictionary d ) { foreach ( DictionaryEntry de in d ) { - this.BaseAdd( (String) de.Key, de.Value ); + this.BaseAdd( (string) de.Key, de.Value ); } } } @@ -70,7 +70,7 @@ public static void Main() { } public static void PrintKeysAndValues2( MyCollection myCol ) { - foreach ( String s in myCol.AllKeys ) { + foreach ( string s in myCol.AllKeys ) { Console.WriteLine( "{0}, {1}", s, myCol[s] ); } } diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/CS/nocb_isreadonly.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/CS/nocb_isreadonly.cs index 82d28f35d36..8406939c1f6 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/CS/nocb_isreadonly.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase.IsReadOnly/CS/nocb_isreadonly.cs @@ -1,4 +1,4 @@ -// The following example creates a read-only collection. +// The following example creates a read-only collection. // For an expanded version of this example, see the NameObjectCollectionBase class topic. // @@ -22,13 +22,13 @@ public DictionaryEntry this[ int index ] { // Adds elements from an IDictionary into the new collection. public MyCollection( IDictionary d, Boolean bReadOnly ) { foreach ( DictionaryEntry de in d ) { - this.BaseAdd( (String) de.Key, de.Value ); + this.BaseAdd( (string) de.Key, de.Value ); } this.IsReadOnly = bReadOnly; } // Adds an entry to the collection. - public void Add( String key, Object value ) { + public void Add( string key, Object value ) { this.BaseAdd( key, value ); } } @@ -69,7 +69,7 @@ public static void PrintKeysAndValues( MyCollection myCol ) { This code produces the following output. System.NotSupportedException: Collection is read-only. - at System.Collections.Specialized.NameObjectCollectionBase.BaseAdd(String name, Object value) + at System.Collections.Specialized.NameObjectCollectionBase.BaseAdd(string name, Object value) at SamplesNameObjectCollectionBase.Main() Read-Only Collection: [0] : red, apple diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs index 040d2ea51cf..186b653d3a4 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.Collections.Specialized.NameObjectCollectionBase/CS/nameobjectcollectionbase.cs @@ -1,4 +1,4 @@ -// The following example shows how to implement and use the NameObjectCollectionBase class. +// The following example shows how to implement and use the NameObjectCollectionBase class. // using System; @@ -14,7 +14,7 @@ public MyCollection() { // Adds elements from an IDictionary into the new collection. public MyCollection( IDictionary d, Boolean bReadOnly ) { foreach ( DictionaryEntry de in d ) { - this.BaseAdd( (String) de.Key, de.Value ); + this.BaseAdd( (string) de.Key, de.Value ); } this.IsReadOnly = bReadOnly; } @@ -28,7 +28,7 @@ public DictionaryEntry this[ int index ] { } // Gets or sets the value associated with the specified key. - public Object this[ String key ] { + public Object this[ string key ] { get { return( this.BaseGet( key ) ); } @@ -37,7 +37,7 @@ public Object this[ String key ] { } } - // Gets a String array that contains all the keys in the collection. + // Gets a string array that contains all the keys in the collection. public String[] AllKeys { get { return( this.BaseGetAllKeys() ); @@ -51,7 +51,7 @@ public Array AllValues { } } - // Gets a String array that contains all the values in the collection. + // Gets a string array that contains all the values in the collection. public String[] AllStringValues { get { return( (String[]) this.BaseGetAllValues( typeof( string ) )); @@ -66,12 +66,12 @@ public Boolean HasKeys { } // Adds an entry to the collection. - public void Add( String key, Object value ) { + public void Add( string key, Object value ) { this.BaseAdd( key, value ); } // Removes an entry with the specified key from the collection. - public void Remove( String key ) { + public void Remove( string key ) { this.BaseRemove( key ); } @@ -144,7 +144,7 @@ public static void PrintKeysAndValues( MyCollection myCol ) { // Prints the keys and values using AllKeys. public static void PrintKeysAndValues2( MyCollection myCol ) { - foreach ( String s in myCol.AllKeys ) { + foreach ( string s in myCol.AllKeys ) { Console.WriteLine( "{0}, {1}", s, myCol[s] ); } } @@ -155,7 +155,7 @@ public static void PrintKeysAndValues2( MyCollection myCol ) { This code produces the following output. System.NotSupportedException: Collection is read-only. - at System.Collections.Specialized.NameObjectCollectionBase.BaseAdd(String name, Object value) + at System.Collections.Specialized.NameObjectCollectionBase.BaseAdd(string name, Object value) at SamplesNameObjectCollectionBase.Main() Read-Only Collection: [0] : red, apple diff --git a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs index 2483db0c27a..512de453ec2 100644 --- a/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs +++ b/samples/snippets/csharp/VS_Snippets_CLR_System/system.collections.specialized.nameobjectcollectionbase.keyscollection/cs/source.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Specialized; @@ -11,7 +11,7 @@ public DerivedCollection() { // Adds elements from an IDictionary into the new collection. public DerivedCollection( IDictionary d, Boolean bReadOnly ) { foreach ( DictionaryEntry de in d ) { - this.BaseAdd( (String) de.Key, de.Value ); + this.BaseAdd( (string) de.Key, de.Value ); } this.IsReadOnly = bReadOnly; } @@ -25,7 +25,7 @@ public DictionaryEntry this[ int index ] { } // Gets or sets the value associated with the specified key. - public Object this[ String key ] { + public Object this[ string key ] { get { return( this.BaseGet( key ) ); } @@ -34,7 +34,7 @@ public Object this[ String key ] { } } - // Gets a String array that contains all the keys in the collection. + // Gets a string array that contains all the keys in the collection. public String[] AllKeys { get { return( this.BaseGetAllKeys() ); @@ -48,7 +48,7 @@ public Array AllValues { } } - // Gets a String array that contains all the values in the collection. + // Gets a string array that contains all the values in the collection. public String[] AllStringValues { get { return( (String[]) this.BaseGetAllValues( typeof( string ) )); @@ -63,12 +63,12 @@ public Boolean HasKeys { } // Adds an entry to the collection. - public void Add( String key, Object value ) { + public void Add( string key, Object value ) { this.BaseAdd( key, value ); } // Removes an entry with the specified key from the collection. - public void Remove( String key ) { + public void Remove( string key ) { this.BaseRemove( key ); }