Skip to content
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
Expand Up @@ -5,14 +5,12 @@

class SafeHandlesExample
{

static void Main()
{
UnmanagedMutex uMutex = new UnmanagedMutex("YourCompanyName_SafeHandlesExample_MUTEX");

try
{

uMutex.Create();
Console.WriteLine("Mutex created. Press Enter to release it.");
Console.ReadLine();
Expand Down Expand Up @@ -58,10 +56,7 @@

public void Create()
{
if (nameValue == null && nameValue.Length == 0)
{
throw new ArgumentNullException("nameValue");
}
ArgumentException.ThrowIfNullOrEmpty(nameValue);

Check failure on line 59 in snippets/csharp/Microsoft.Win32.SafeHandles/SafeWaitHandle/Overview/sample.cs

View workflow job for this annotation

GitHub Actions / snippets-build

D:\a\dotnet-api-docs\dotnet-api-docs\snippets\csharp\Microsoft.Win32.SafeHandles\SafeWaitHandle\Overview\sample.cs(59,27): error CS0117: 'ArgumentException' does not contain a definition for 'ThrowIfNullOrEmpty' [D:\a\dotnet-api-docs\dotnet-api-docs\snippets\csharp\Microsoft.Win32.SafeHandles\SafeWaitHandle\Overview\Project.csproj]

handleValue = CreateMutex(mutexAttrValue,
true, nameValue);
Expand Down Expand Up @@ -105,4 +100,4 @@
ReleaseMutex(handleValue);
}
}
//</Snippet1>
//</Snippet1>
Loading