Skip to content
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
@@ -1,11 +1,9 @@

// The following code example calls GetMonthsInYear for 5 years in each era.
// <snippet1>
using namespace System;
using namespace System::Globalization;

int main()
{

// Creates and initializes a JapaneseCalendar.
JapaneseCalendar^ myCal = gcnew JapaneseCalendar;

Expand All @@ -28,19 +26,5 @@ int main()
for ( int y = 1; y <= 5; y++ )
Console::Write( "\t {0}", myCal->GetMonthsInYear( y, myCal->Eras[ i ] ) );
Console::WriteLine();

}
}

/*
This code produces the following output.

YEAR 1 2 3 4 5
CurrentEra: 12 12 12 12 12
Era 4: 12 12 12 12 12
Era 3: 12 12 12 12 12
Era 2: 12 12 12 12 12
Era 1: 12 12 12 12 12

*/
// </snippet1>
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@

// The following code example calls IsLeapDay for the last day of the second
// month (February) for five years in each of the eras.
// <snippet1>
using namespace System;
using namespace System::Globalization;

int main()
{

// Creates and initializes a JapaneseCalendar.
JapaneseCalendar^ myCal = gcnew JapaneseCalendar;

Expand Down Expand Up @@ -37,22 +34,19 @@ int main()
{
iLastDay = myCal->GetDaysInMonth( y, 2, myCal->Eras[ i ] );
Console::Write( "\t {0}", myCal->IsLeapDay( y, 2, iLastDay, myCal->Eras[ i ] ) );

}
Console::WriteLine();

}
}

/*
This code produces the following output.

YEAR 1 2 3 4 5
CurrentEra: False False False True False
CurrentEra: False True False False False
Era 5: False True False False False
Era 4: False False False True False
Era 3: False False True False False
Era 2: True False False False True
Era 1: True False False False True

*/
// </snippet1>
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@

// The following code example calls IsLeapYear for five years in each of the eras.
// <snippet1>
using namespace System;
using namespace System::Globalization;

int main()
{

{
// Creates and initializes a JapaneseCalendar.
JapaneseCalendar^ myCal = gcnew JapaneseCalendar;

Expand All @@ -28,19 +25,17 @@ int main()
for ( int y = 1; y <= 5; y++ )
Console::Write( "\t {0}", myCal->IsLeapYear( y, myCal->Eras[ i ] ) );
Console::WriteLine();

}
}

/*
This code produces the following output.

YEAR 1 2 3 4 5
CurrentEra: False False False True False
CurrentEra: False True False False False
Era 5: False True False False False
Era 4: False False False True False
Era 3: False False True False False
Era 2: True False False False True
Era 1: True False False False True

*/
// </snippet1>
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// <Snippet7>
using System;
using System.Globalization;

Expand Down Expand Up @@ -26,13 +25,3 @@ public static void Main()
}
}
}
// The example displays the following output:
// Date instantiated without an era:
// 1/1/2 in Japanese Calendar -> 1/1/1990 in Gregorian
//
// Dates instantiated with eras:
// 1/1/2 era 4 in Japanese Calendar -> 1/1/1990 in Gregorian
// 1/1/2 era 3 in Japanese Calendar -> 1/1/1927 in Gregorian
// 1/1/2 era 2 in Japanese Calendar -> 1/1/1913 in Gregorian
// 1/1/2 era 1 in Japanese Calendar -> 1/1/1869 in Gregorian
// </Snippet7>
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// The following code example calls GetMonthsInYear for 5 years in each era.

// <snippet1>
using System;
using System.Globalization;


public class SamplesJapaneseCalendar {

public static void Main() {
Expand All @@ -13,38 +9,23 @@ public static void Main() {
JapaneseCalendar myCal = new JapaneseCalendar();

// Displays the header.
Console.Write( "YEAR\t" );
for ( int y = 1; y <= 5; y++ )
Console.Write( "\t{0}", y );
Console.Write("YEAR\t");
for (int y = 1; y <= 5; y++ )
Console.Write($"\t{y}");
Console.WriteLine();

// Displays the value of the CurrentEra property.
Console.Write( "CurrentEra:" );
for ( int y = 1; y <= 5; y++ )
Console.Write( "\t{0}", myCal.GetMonthsInYear( y, JapaneseCalendar.CurrentEra ) );
Console.Write("CurrentEra:");
for (int y = 1; y <= 5; y++ )
Console.Write($"\t{myCal.GetMonthsInYear(y, JapaneseCalendar.CurrentEra)}");
Console.WriteLine();

// Displays the values in the Eras property.
for ( int i = 0; i < myCal.Eras.Length; i++ ) {
Console.Write( "Era {0}:\t", myCal.Eras[i] );
for ( int y = 1; y <= 5; y++ )
Console.Write( "\t{0}", myCal.GetMonthsInYear( y, myCal.Eras[i] ) );
for (int i = 0; i < myCal.Eras.Length; i++ ) {
Console.Write($"Era {myCal.Eras[i]}:\t");
for (int y = 1; y <= 5; y++ )
Console.Write("\t{myCal.GetMonthsInYear(y, myCal.Eras[i])}");
Console.WriteLine();
}

}

}

/*
This code produces the following output.

YEAR 1 2 3 4 5
CurrentEra: 12 12 12 12 12
Era 4: 12 12 12 12 12
Era 3: 12 12 12 12 12
Era 2: 12 12 12 12 12
Era 1: 12 12 12 12 12

*/
// </snippet1>
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// The following code example calls IsLeapDay for the last day of the second month (February) for five years in each of the eras.

// <snippet1>
using System;
using System.Globalization;


public class SamplesJapaneseCalendar {

public static void Main() {

public class SamplesJapaneseCalendar
{
public static void Main()
{
// Creates and initializes a JapaneseCalendar.
JapaneseCalendar myCal = new JapaneseCalendar();

Expand Down Expand Up @@ -38,20 +34,17 @@ public static void Main() {
}
Console.WriteLine();
}

}

}

/*
This code produces the following output.

YEAR 1 2 3 4 5
CurrentEra: False False False True False
CurrentEra: False True False False False
Era 5: False True False False False
Era 4: False False False True False
Era 3: False False True False False
Era 2: True False False False True
Era 1: True False False False True

*/
// </snippet1>
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// The following code example calls IsLeapYear for five years in each of the eras.

// <snippet1>
using System;
using System.Globalization;


public class SamplesJapaneseCalendar {

public static void Main() {

public class SamplesJapaneseCalendar
{
public static void Main()
{
// Creates and initializes a JapaneseCalendar.
JapaneseCalendar myCal = new JapaneseCalendar();

Expand All @@ -31,20 +27,17 @@ public static void Main() {
Console.Write( "\t{0}", myCal.IsLeapYear( y, myCal.Eras[i] ) );
Console.WriteLine();
}

}

}

/*
This code produces the following output.

YEAR 1 2 3 4 5
CurrentEra: False False False True False
CurrentEra: False True False False False
Era 5: False True False False False
Era 4: False False False True False
Era 3: False False True False False
Era 2: True False False False True
Era 1: True False False False True

*/
// </snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// follows:
// Open a console window and run the listener from the command line.
// In another console window run the sender. In both cases you must specify
// the local IPAddress to use. To obtain this address run the ipconfig comand
// the local IPAddress to use. To obtain this address run the ipconfig command
// from the command line.
//
namespace Mssc.TransportProtocols.Utilities
Expand Down Expand Up @@ -141,4 +141,4 @@ public static void Main(String[] args)
}
}
}
// </Snippet1>
// </Snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void Main(string[] args)

// Because dynamic_ec is dynamic, the following call to exampleMethod
// with two arguments does not produce an error at compile time.
// However, itdoes cause a run-time error.
// However, it does cause a run-time error.
//Console.WriteLine(dynamic_ec.exampleMethod(10, 4));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void OnLoaded(object sender, RoutedEventArgs e)
KeyGesture pasteBind = new KeyGesture(Key.V, ModifierKeys.Alt);
ApplicationCommands.Paste.InputGestures.Add(pasteBind);

// <SnippetInputBindingAddingComand>
// <SnippetInputBindingAddingCommand>
KeyGesture HelpCmdKeyGesture = new KeyGesture(Key.H,
ModifierKeys.Alt);

Expand All @@ -134,7 +134,7 @@ private void OnLoaded(object sender, RoutedEventArgs e)
HelpCmdKeyGesture);

this.InputBindings.Add(inputBinding);
// </SnippetInputBindingAddingComand>
// </SnippetInputBindingAddingCommand>

// <SnippetMouseBindingMouseAction>
MouseGesture CutCmdMouseGesture = new MouseGesture(
Expand Down Expand Up @@ -262,4 +262,4 @@ private void cmdButtonClick(object sender, RoutedEventArgs e)
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class GetDotNetVersion
{
public static void Main()
{
GetDotNetVersion.Get45PlusFromRegistry();
Get45PlusFromRegistry();
}

private static void Get45PlusFromRegistry()
Expand All @@ -15,7 +15,7 @@ private static void Get45PlusFromRegistry()
using (var ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(subkey))
{
if (ndpKey != null && ndpKey.GetValue("Release") != null) {
Console.WriteLine(".NET Framework Version: " + CheckFor45PlusVersion((int) ndpKey.GetValue("Release")));
Console.WriteLine($".NET Framework Version: {CheckFor45PlusVersion((int) ndpKey.GetValue("Release"))}");
}
else {
Console.WriteLine(".NET Framework Version 4.5 or later is not detected.");
Expand All @@ -25,8 +25,10 @@ private static void Get45PlusFromRegistry()
// Checking the version using >= enables forward compatibility.
string CheckFor45PlusVersion(int releaseKey)
{
if (releaseKey >= 461808)
if (releaseKey > 461814)
return "4.7.2 or later";
if (releaseKey >= 461808)
return "4.7.2";
if (releaseKey >= 461308)
return "4.7.1";
if (releaseKey >= 460798)
Expand Down
Loading