private void InitDefaultNetworkActionsButton() { NSMenuItem menuUntrusted = new NSMenuItem("", OnNetworksDefaultAction_Changed) { AttributedTitle = AttributedString.Create(LocalizedStrings.Instance.LocalizedString("NetworkConfig_Untrusted"), NSColor.SystemRedColor, NSTextAlignment.Left), Tag = (int)NetworkActionsConfig.WiFiActionTypeEnum.Untrusted }; NSMenuItem menuTrusted = new NSMenuItem("", OnNetworksDefaultAction_Changed) { AttributedTitle = AttributedString.Create(LocalizedStrings.Instance.LocalizedString("NetworkConfig_Trusted"), NSColor.SystemBlueColor, NSTextAlignment.Left), Tag = (int)NetworkActionsConfig.WiFiActionTypeEnum.Trusted }; NSMenuItem menuNoAction = new NSMenuItem("", OnNetworksDefaultAction_Changed) { AttributedTitle = AttributedString.Create(LocalizedStrings.Instance.LocalizedString("NetworkConfig_NoAction"), NSColor.SystemGrayColor, NSTextAlignment.Left), Tag = (int)NetworkActionsConfig.WiFiActionTypeEnum.None }; NetworksDefaultActionBtn.Menu.RemoveAllItems(); NetworksDefaultActionBtn.Menu.AddItem(menuUntrusted); NetworksDefaultActionBtn.Menu.AddItem(menuTrusted); NetworksDefaultActionBtn.Menu.AddItem(menuNoAction); if (NetworksDefaultActionBtn.Menu.Delegate == null) { NetworksDefaultActionBtn.Menu.Delegate = new MenuDelegateInvertHighlitedItem(); } NetworksDefaultActionBtn.SelectItemWithTag((int)__Settings.NetworkActions.DefaultActionType); }
void ReleaseDesignerOutlets() { if (AntiTrackerSettings != null) { AntiTrackerSettings.Dispose(); AntiTrackerSettings = null; } if (ConnectionSettingsView != null) { ConnectionSettingsView.Dispose(); ConnectionSettingsView = null; } if (DnsSettings != null) { DnsSettings.Dispose(); DnsSettings = null; } if (FirewallSettingsView != null) { FirewallSettingsView.Dispose(); FirewallSettingsView = null; } if (GeneralSettingsView != null) { GeneralSettingsView.Dispose(); GeneralSettingsView = null; } if (GuiBtnFirewallTypeAlwaysOn != null) { GuiBtnFirewallTypeAlwaysOn.Dispose(); GuiBtnFirewallTypeAlwaysOn = null; } if (GuiBtnFirewallTypeOnDemand != null) { GuiBtnFirewallTypeOnDemand.Dispose(); GuiBtnFirewallTypeOnDemand = null; } if (GuiBtnLaunchAtLogin != null) { GuiBtnLaunchAtLogin.Dispose(); GuiBtnLaunchAtLogin = null; } if (GuiBtnProtocolTypeOpenVPN != null) { GuiBtnProtocolTypeOpenVPN.Dispose(); GuiBtnProtocolTypeOpenVPN = null; } if (GuiBtnProtocolTypeWireGuard != null) { GuiBtnProtocolTypeWireGuard.Dispose(); GuiBtnProtocolTypeWireGuard = null; } if (GuiBtnWireguardTooltip != null) { GuiBtnWireguardTooltip.Dispose(); GuiBtnWireguardTooltip = null; } if (GuiButtonOpenvpnTooltip != null) { GuiButtonOpenvpnTooltip.Dispose(); GuiButtonOpenvpnTooltip = null; } if (GuiPanelOpenvpnTooltip != null) { GuiPanelOpenvpnTooltip.Dispose(); GuiPanelOpenvpnTooltip = null; } if (GuiPanelWireguardConfigDetails != null) { GuiPanelWireguardConfigDetails.Dispose(); GuiPanelWireguardConfigDetails = null; } if (GuiPanelWireguardTooltip != null) { GuiPanelWireguardTooltip.Dispose(); GuiPanelWireguardTooltip = null; } if (GuiProgressViewWireguardKeysGeneration != null) { GuiProgressViewWireguardKeysGeneration.Dispose(); GuiProgressViewWireguardKeysGeneration = null; } if (GuiProgressWireguardKeysGeneration != null) { GuiProgressWireguardKeysGeneration.Dispose(); GuiProgressWireguardKeysGeneration = null; } if (GuiProtocolsConfigTabView != null) { GuiProtocolsConfigTabView.Dispose(); GuiProtocolsConfigTabView = null; } if (GuiTabConfigOpenVPN != null) { GuiTabConfigOpenVPN.Dispose(); GuiTabConfigOpenVPN = null; } if (GuiTabConfigWireGuard != null) { GuiTabConfigWireGuard.Dispose(); GuiTabConfigWireGuard = null; } if (GuiViewWireguardConfig != null) { GuiViewWireguardConfig.Dispose(); GuiViewWireguardConfig = null; } if (GuiWireguardConfigDetailsProgressIndicator != null) { GuiWireguardConfigDetailsProgressIndicator.Dispose(); GuiWireguardConfigDetailsProgressIndicator = null; } if (GuiWireguardConfigDetailsView != null) { GuiWireguardConfigDetailsView.Dispose(); GuiWireguardConfigDetailsView = null; } if (GuiWireguardConfigDetailsViewProgress != null) { GuiWireguardConfigDetailsViewProgress.Dispose(); GuiWireguardConfigDetailsViewProgress = null; } if (GuiWireGuardDescription != null) { GuiWireGuardDescription.Dispose(); GuiWireGuardDescription = null; } if (NetworksDefaultActionBtn != null) { NetworksDefaultActionBtn.Dispose(); NetworksDefaultActionBtn = null; } if (NetworksSettings != null) { NetworksSettings.Dispose(); NetworksSettings = null; } if (NetworksView != null) { NetworksView.Dispose(); NetworksView = null; } if (OpenVPNSettings != null) { OpenVPNSettings.Dispose(); OpenVPNSettings = null; } if (OpenVpnViewExtraParameters != null) { OpenVpnViewExtraParameters.Dispose(); OpenVpnViewExtraParameters = null; } if (SettingsView != null) { SettingsView.Dispose(); SettingsView = null; } if (Toolbar != null) { Toolbar.Dispose(); Toolbar = null; } if (GuiOpenVpnUserConfigFile != null) { GuiOpenVpnUserConfigFile.Dispose(); GuiOpenVpnUserConfigFile = null; } }