Skip to content

Merge main into live #9710

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 1 commit into from
Mar 12, 2024
Merged
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,18 +1,16 @@
//<snippet1>

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;

public class App {

public class App
{
private static PerformanceCounter avgCounter64Sample;
private static PerformanceCounter avgCounter64SampleBase;

public static void Main()
{

ArrayList samplesList = new ArrayList();

// If the category does not exist, create the category and exit.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//<Snippet1>

using System;
using System.Diagnostics;
using System.Globalization;
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ public class App
{
private static PerformanceCounter PC;


public static void Main()
{
ArrayList samplesList = new ArrayList();
@@ -26,12 +25,10 @@ public static void Main()
CollectSamples(samplesList);
}


private static bool SetupCategory()
{
if ( !PerformanceCounterCategory.Exists("ElapsedTimeSampleCategory") )
{

CounterCreationDataCollection CCDC = new CounterCreationDataCollection();

// Add the counter.
@@ -60,12 +57,10 @@ private static void CreateCounters()
PC = new PerformanceCounter("ElapsedTimeSampleCategory",
"ElapsedTimeSample",
false);

}

private static void CollectSamples(ArrayList samplesList)
{

long pcValue;
DateTime Start;

@@ -98,7 +93,6 @@ private static void CollectSamples(ArrayList samplesList)

Console.WriteLine("Elapsed time = " + DateTime.Now.Subtract(Start).ToString());
}


private static void OutputSample(CounterSample s)
{
@@ -115,7 +109,6 @@ private static void OutputSample(CounterSample s)
Console.WriteLine("++++++++++++++++++++++");
}


// Reads the counter information to enable setting the RawValue.
[DllImport("Kernel32.dll")]
public static extern bool QueryPerformanceCounter(out long value);
@@ -126,7 +119,6 @@ private static void OutputSample(CounterSample s)
// Build sample for Whidbey or higher.

//<Snippet2>

using System;
using System.Collections;
using System.Collections.Specialized;
@@ -135,7 +127,6 @@ private static void OutputSample(CounterSample s)

public class App
{

public static void Main()
{
CollectSamples();
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
// The sort command results are displayed to the user on the console.

// <Snippet1>

using System;
using System.IO;
using System.Diagnostics;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//<snippet1>

using System;
using System.Windows.Forms;
using System.Drawing;
2 changes: 0 additions & 2 deletions snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//<SNIPPET1>

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -12,7 +11,6 @@

namespace Microsoft.Samples.MoveTo.CS
{

class Program
{
private static string sourcePath = Environment.GetFolderPath
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <snippet0>

using System;
using System.Messaging;

@@ -38,5 +37,4 @@ public static void UseQueue()
// </snippet1>
}
}

// </snippet0>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <snippet0>

using System;
using System.Messaging;

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <snippet0>

using System;
using System.Messaging;

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <snippet0>

using System;
using System.Messaging;

Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
// available.

// <Snippet1>

using System;
using System.Net;
using System.Net.Sockets;
3 changes: 0 additions & 3 deletions snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs
Original file line number Diff line number Diff line change
@@ -7,17 +7,14 @@ input string into the correct internal format.
*/

// <Snippet1>

using System;
using System.Net;
using System.Net.Sockets;

class IsLoopbackTest
{

private static void Main(string[] args)
{

if (args.Length == 0)
{
// No parameters entered. Display program usage.
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
*/
// <Snippet1>
// <Snippet2>

using System;
using System.Net;
using System.IO;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <Snippet1>

using System;
using System.Text;
using System.Threading;
@@ -296,7 +295,4 @@ public static void Main() {
new object[0]);
}
}



// </Snippet1>
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@ in the main method. */
// <Snippet3>
// <Snippet4>
// <Snippet5>

using System;
using System.Collections;
using System.Threading;
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@ custom attributes of the Enum type and displays its contents on the console.
*/

// <Snippet1>

using System;
using System.Threading;
using System.Reflection;
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// <Snippet1>

using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

class DynamicJumpTableDemo

{

public static Type BuildMyType()
{
AppDomain myDomain = Thread.GetDomain();
@@ -110,5 +107,4 @@ public static void Main()
new object[] {theValue}));
}
}

// </Snippet1>
Original file line number Diff line number Diff line change
@@ -3,14 +3,11 @@
using System.Reflection.Emit;

class MyDynamicAssembly

{

public static void BuildDynamicMethod(TypeBuilder myTypeBuilder,
Type[] mthdParamTypes,
Type returnType,
int addrOfLegacyNumberObject)

{
// <Snippet1>
MethodBuilder myMthdBuilder = myTypeBuilder.DefineMethod("MyMethod",
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// <Snippet1>

using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

class TestILGenerator {

public static Type DynamicDotProductGen() {

class TestILGenerator
{
public static Type DynamicDotProductGen()
{
Type ivType = null;
Type[] ctorParams = new Type[] { typeof(int),
typeof(int),
@@ -179,5 +178,4 @@ public static void Main() {
// (10, 10, 10) . (20, 20, 20) = 600
}
}

// </Snippet1>
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// <Snippet1>

using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

class PropertyBuilderDemo

{

public static Type BuildDynamicTypeWithProperties()
{
AppDomain myDomain = Thread.GetDomain();
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <Snippet1>

using System;
using System.Reflection;
using System.Reflection.Emit;
@@ -96,5 +95,4 @@ public Assembly ResolveEvent(Object sender, ResolveEventArgs args)
return m_Module.Assembly;
}
}

// </Snippet1>
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ assembly is also saved to a file named 'MyAssembly.exe'.
// <Snippet1>
// <Snippet2>
// <Snippet3>

using System;
using System.Reflection;
using System.Threading;
@@ -54,7 +53,6 @@ public static void MakeAssembly(AssemblyName myAssemblyName, string fileName)

public static void Main()
{

// Create a dynamic assembly with name 'MyAssembly' and build version '1.0.0.2001'.
AssemblyName myAssemblyName = new AssemblyName();
myAssemblyName.Name = "MyAssembly";
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// <Snippet1>

using System;
using System.Reflection;

//Make two fields, one public and one read-only.
//Make two fields, one public and one read-only.
public class Myfielda
{
public string field = "A - public modifiable field";
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <Snippet1>

using System;
using System.Reflection;

Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ then the attributes of all the parameters of the method named 'MyMethod' is
// <Snippet1>
// <Snippet2>
// <Snippet3>

using System;
using System.Reflection;
using System.Threading;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//<snippet1>

using System;
using System.Runtime.InteropServices;

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// System.Runtime.InteropServices.TypeLibVarAttribute
// System.Runtime.InteropServices.TypeLibVarFlags
// <Snippet1>

using System;
using System.Reflection;
using System.Runtime.InteropServices;
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ interface. It then adds a few headers to the header list and displays them.
*/

// <Snippet1>

using System;
using System.Collections;
using System.Runtime.Remoting;
@@ -88,5 +87,4 @@ public static void Main()
// </Snippet3>
// </Snippet2>
}

// </Snippet1>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <Snippet2>

using System;
using System.Collections;
using System.Runtime.Remoting;
@@ -31,5 +30,4 @@ public static void Main() {
}
}
}

// </Snippet2>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <Snippet3>

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
//
//-----------------------------------------------------------------------------
//<Snippet1>

using System;

namespace ClaimsAuthorizationLibrary
Loading