Add NativeFileDialogs.Net examples

They look much easier to deal with, don't they?
This commit is contained in:
Speykious committed 2022-03-27 19:40:16 +02:00
1 parent 732fcb176e
commit cd5c3d37dc
9 files changed
+191

No files matched your search

@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\NativeFileDialogs.Net\NativeFileDialogs.Net.csproj" />
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="0.1.0-alpha" />
</ItemGroup>
</Project>
@@ -0,0 +1,24 @@
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.
using System;
using System.Collections.Generic;
using NativeFileDialogs.Net;
NfdStatus result = Nfd.OpenDialogMultiple(out string[]? outPaths, new Dictionary<string, string>()
{
{ "Source code", "c,cpp,cc" },
{ "Headers", "h,hpp" },
});
if (result == NfdStatus.Ok && outPaths is string[] paths)
{
Console.WriteLine("Success!");
foreach (string path in paths)
Console.WriteLine($"- {path}");
}
else
{
Console.WriteLine("User pressed Cancel.");
}