MCPcopy Create free account
hub / github.com/YtFlow/Maple / GenerateProfileButton_Click

Method GenerateProfileButton_Click

Maple.App/MainPage.cpp:521–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519 }
520
521 fire_and_forget MainPage::GenerateProfileButton_Click(IInspectable const& sender, RoutedEventArgs const& e)
522 {
523 try {
524 const auto lifetime = get_strong();
525 const auto& profile = VpnPlugInProfile{};
526 profile.AlwaysOn(false);
527 profile.ProfileName(L"Maple");
528 profile.RequireVpnClientAppUI(true);
529 profile.VpnPluginPackageFamilyName(Windows::ApplicationModel::Package::Current().Id().FamilyName());
530 profile.RememberCredentials(false);
531 profile.ServerUris().Append(Uri{ L"https://github.com/YtFlow/Maple" });
532 const auto& result = co_await VpnMgmtAgent.AddProfileFromObjectAsync(profile);
533 if (result == VpnManagementErrorStatus::Ok) {
534 co_await NotifyUser(L"Profile generated.");
535 }
536 else {
537 co_await NotifyUser(L"Failed to generate a profile (" + to_hstring(static_cast<int32_t>(result)) + L").");
538 }
539 }
540 catch (...)
541 {
542 UI::NotifyException(L"Generating profile");
543 }
544 }
545
546 fire_and_forget MainPage::ConnectionToggleSwitch_Toggled(IInspectable const&, RoutedEventArgs const&)
547 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected