Ejemplo n.º 1
0
        private void tglHostItem_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var toggle = (ToggleSwitch)sender;
            var kvp    = (HostStatus)toggle.DataContext;

            if (toggle.IsChecked.Value)
            {
                _hostsFileHelper.UnblockHostUrl(kvp.Host);
            }
            else
            {
                _hostsFileHelper.BlockHostUrl(kvp.Host);
            }
            ShowUpdateNotice();
        }
        private void ToggleHostItem(object sender, System.Windows.RoutedEventArgs e)
        {
            var toggle = (ToggleSwitch)sender;
            var kvp    = (HostStatus)toggle.DataContext;

            if (toggle.IsChecked.Value)
            {
                _hostsFileHelper.UnblockHostUrl(kvp.Host);
                Wu10Logger.LogInfo($"Host UNBLOCKED: {kvp.Host}");
            }
            else
            {
                _hostsFileHelper.BlockHostUrl(kvp.Host);
                Wu10Logger.LogInfo($"Host BLOCKED: {kvp.Host}");
            }

            ShowUpdateNotice();
        }