Skip to content

Samples fixes for Batch 13 of .NET Interactive changes #4457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int main()

/*
This example of the Attribute::TypeId property
generates the following output.
generates output similar to the following:

Create instances from a derived Attribute class that implements TypeId,
and then display the attributes and corresponding TypeId values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main()
}

/*
This example of the BitConverter::ToChar( unsigned char[ ], int )
This example of the BitConverter::ToChar(unsigned char[ ], int)
method generates the following output. It converts elements of a
byte array to __wchar_t values.

Expand All @@ -51,9 +51,9 @@ index array elements __wchar_t
3 2A-00 *
5 41-00 A
7 7D-00 }
9 C5-00
11 A8-03 ?
13 29-04 ?
15 AC-20 ?
9 C5-00 Å
11 A8-03 Ψ
13 29-04 Щ
15 AC-20
*/
//</Snippet2>
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ int main()
}

/*
This code produces the following output. The question marks take the place of native script characters.
This code produces the following output:

CULTURE PROPERTY VALUE
en-US dddd, MMMM dd, yyyy
ja-JP yyyy'?'M'?'d'?'
ja-JP yyyy''M''d''
fr-FR dddd d MMMM yyyy

*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public static void Main()
Console.WriteLine("{0}: {1} ({2:p1})", i + 1, results[i], (double)results[i] / (double)totalRolls);
}
rngCsp.Dispose();
Console.ReadLine();
}

// This method simulates a roll of the dice. The input parameter is the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ static void EnumTextElementIndexes(String s) {
}
}

// This code produces the following output.
// This code produces the following output:
//
// Result of GetTextElementEnumerator:
// Character at index 0 is 'a-"'
// Character at index 0 is 'ā̈'
// Character at index 3 is 'b'
// Character at index 4 is 'c,'
// Character at index 4 is ''
//
// Result of ParseCombiningCharacters:
// Character 0 starts at index 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void Main( )

/*
This example of the Attribute.TypeId property
generates the following output.
generates output similar to the following:

Create instances from a derived Attribute class that implements TypeId,
and then display the attributes and corresponding TypeId values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void Main( )
}

/*
This example of the BitConverter.ToChar( byte[ ], int )
This example of the BitConverter.ToChar(byte[ ], int)
method generates the following output. It converts
elements of a byte array to char values.

Expand All @@ -62,8 +62,8 @@ 3 2A-00 *
5 41-00 A
7 7D-00 }
9 C5-00 Å
11 A8-03 ?
13 29-04 ?
15 AC-20 ?
11 A8-03 Ψ
13 29-04 Щ
15 AC-20
*/
//</Snippet2>
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public static void PrintPattern( String myCulture ) {
}

/*
This code produces the following output. The question marks take the place of native script characters.
This code produces the following output:

CULTURE PROPERTY VALUE
en-US dddd, MMMM d, yyyy
ja-JP yyyy'?'M'?'d'?'
ja-JP yyyy''M''d''
fr-FR dddd d MMMM yyyy

*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Example
{
public static void Main()
{
DateTime date1 = new DateTime(2001, 11, 12);
DateTime date1 = new DateTime(2011, 11, 12);
string[] cultureNames = { "en-US", "fr-FR", "ru-RU", "de-DE" };
Console.WriteLine("{0,-7} {1,-20} {2:D}\n", "Culture", "Long Date Pattern", "Date");
foreach (var cultureName in cultureNames) {
Expand All @@ -20,7 +20,8 @@ public static void Main()
}
// The example displays the following output:
// Culture Long Date Pattern Date
// en-US dddd, MMMM d, yyyy Saturday, November 12, 2011
//
// en-US dddd, MMMM d, yyyy Saturday, November 12, 2011
// fr-FR dddd d MMMM yyyy samedi 12 novembre 2011
// ru-RU d MMMM yyyy 'г.' 12 ноября 2011 г.
// de-DE dddd, d. MMMM yyyy Samstag, 12. November 2011
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static string GetCalendarName(Calendar cal)
//
// Gregorian-Localized dd MMMM, yyyy 07 آب, 2011
// UmAlQura dd/MMMM/yyyy 07/رمضان/1432
// Hijri dd/MM/yyyy 08/09/1432
// Hijri dd MMMM, yyyy 08 رمضان, 1432
// Gregorian-USEnglish dddd, MMMM dd, yyyy Sunday, August 07, 2011
// Gregorian-MiddleEastFrench dddd, MMMM dd, yyyy dimanche, août 07, 2011
// Gregorian-TransliteratedEnglish dddd, MMMM dd, yyyy الأحد, أغسطس 07, 2011
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ private static void CallToStringWithSpecifiersAndCultures()
// G format using es-ES culture: 1679 -3045
//
// C format using en-US culture: $1,679.00 ($3,045.00)
// C format using fr-FR culture: 1 679,00 ? -3 045,00 ?
// C format using es-ES culture: 1.679,00 ? -3.045,00 ?
// C format using fr-FR culture: 1 679,00 -3 045,00
// C format using es-ES culture: 1.679,00 -3.045,00
//
// D8 format using en-US culture: 00001679 -00003045
// D8 format using fr-FR culture: 00001679 -00003045
Expand All @@ -140,13 +140,13 @@ private static void CallToStringWithSpecifiersAndCultures()
// N format using fr-FR culture: 1 679,00 -3 045,00
// N format using es-ES culture: 1.679,00 -3.045,00
//
// P format using en-US culture: 167,900.00 % -304,500.00 %
// P format using en-US culture: 167,900.00% -304,500.00%
// P format using fr-FR culture: 167 900,00 % -304 500,00 %
// P format using es-ES culture: 167.900,00 % -304.500,00 %
//
// X8 format using en-US culture: 0000068F FFFFF41B
// X8 format using fr-FR culture: 0000068F FFFFF41B
// X8 format using es-ES culture: 0000068F FFFFF41B
// X8 format using en-US culture: 0000068F FFFFFFFFFFFFF41B
// X8 format using fr-FR culture: 0000068F FFFFFFFFFFFFF41B
// X8 format using es-ES culture: 0000068F FFFFFFFFFFFFF41B
// </Snippet4>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Class RNGCSP
i += 1
End While
rngCsp.Dispose()
Console.ReadLine()
End Sub


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ Public Module Example
End Sub
End Module
' The example displays the following output:
'
' Result of GetTextElementEnumerator:
' Character at index 0 is 'a-"'
' Character at index 0 is 'ā̈'
' Character at index 3 is 'b'
' Character at index 4 is 'c,'
' Character at index 4 is ''
'
' Result of ParseCombiningCharacters:
' Character 0 starts at index 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Namespace NDP_UE_VB
End Namespace ' NDP_UE_VB

' This example of the Attribute.TypeId property
' generates the following output.
' generates output similar to the following:
'
' Create instances from a derived Attribute class that implements TypeId,
' and then display the attributes and corresponding TypeId values:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ End Module
' initial Byte array
' ------------------
' 20-00-00-2A-00-41-00-7D-00-C5-00-A8-03-29-04-AC-20
'
'
' index array elements Char
' ----- -------------- ----
' 0 20-00
Expand All @@ -60,7 +60,7 @@ End Module
' 5 41-00 A
' 7 7D-00 }
' 9 C5-00 Å
' 11 A8-03 ?
' 13 29-04 ?
' 15 AC-20 ?
' 11 A8-03 Ψ
' 13 29-04 Щ
' 15 AC-20
'</Snippet2>
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Public Class SamplesDTFI

End Class

'This code produces the following output. The question marks take the place of native script characters.
'This code produces the following output:
'
' CULTURE PROPERTY VALUE
' en-US dddd, MMMM d, yyyy
' ja-JP yyyy'?'M'?'d'?'
' ja-JP yyyy''M''d''
' fr-FR dddd d MMMM yyyy
'
' </snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Module Example
End Module
' The example displays the following output:
' Culture Long Date Pattern Date
' en-US dddd, MMMM d, yyyy Saturday, November 12, 2011
'
' en-US dddd, MMMM d, yyyy Saturday, November 12, 2011
' fr-FR dddd d MMMM yyyy samedi 12 novembre 2011
' ru-RU d MMMM yyyy 'г.' 12 ноября 2011 г.
' de-DE dddd, d. MMMM yyyy Samstag, 12. November 2011
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ End Module
'
' Gregorian-Localized dd MMMM, yyyy 07 آب, 2011
' UmAlQura dd/MMMM/yyyy 07/رمضان/1432
' Hijri dd/MM/yyyy 08/09/1432
' Hijri dd MMMM, yyyy 08 رمضان, 1432
' Gregorian-USEnglish dddd, MMMM dd, yyyy Sunday, August 07, 2011
' Gregorian-MiddleEastFrench dddd, MMMM dd, yyyy dimanche, août 07, 2011
' Gregorian-TransliteratedEnglish dddd, MMMM dd, yyyy الأحد, أغسطس 07, 2011
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,37 +111,38 @@ Module LongToString
Console.WriteLine()
Next
' The example displays the following output to the console:
'
' G format using en-US culture: 1679 -3045
' G format using fr-FR culture: 1679 -3045
' G format using es-ES culture: 1679 -3045
'
'
' C format using en-US culture: $1,679.00 ($3,045.00)
' C format using fr-FR culture: 1 679,00 ? -3 045,00 ?
' C format using es-ES culture: 1.679,00 ? -3.045,00 ?
'
' C format using fr-FR culture: 1 679,00 -3 045,00
' C format using es-ES culture: 1.679,00 -3.045,00
'
' D8 format using en-US culture: 00001679 -00003045
' D8 format using fr-FR culture: 00001679 -00003045
' D8 format using es-ES culture: 00001679 -00003045
'
'
' E2 format using en-US culture: 1.68E+003 -3.05E+003
' E2 format using fr-FR culture: 1,68E+003 -3,05E+003
' E2 format using es-ES culture: 1,68E+003 -3,05E+003
'
'
' F format using en-US culture: 1679.00 -3045.00
' F format using fr-FR culture: 1679,00 -3045,00
' F format using es-ES culture: 1679,00 -3045,00
'
'
' N format using en-US culture: 1,679.00 -3,045.00
' N format using fr-FR culture: 1 679,00 -3 045,00
' N format using es-ES culture: 1.679,00 -3.045,00
'
' P format using en-US culture: 167,900.00 % -304,500.00 %
'
' P format using en-US culture: 167,900.00% -304,500.00%
' P format using fr-FR culture: 167 900,00 % -304 500,00 %
' P format using es-ES culture: 167.900,00 % -304.500,00 %
'
' X8 format using en-US culture: 0000068F FFFFF41B
' X8 format using fr-FR culture: 0000068F FFFFF41B
' X8 format using es-ES culture: 0000068F FFFFF41B
'
' X8 format using en-US culture: 0000068F FFFFFFFFFFFFF41B
' X8 format using fr-FR culture: 0000068F FFFFFFFFFFFFF41B
' X8 format using es-ES culture: 0000068F FFFFFFFFFFFFF41B
' </Snippet4>
End Sub
End Module
Expand Down