Exemple #1
0
        public void AutoFixUpdate(Model.AutoFixType selection, IntPtr hwnd)
        {
            switch (selection)  // Properties.Settings.Default.AutoFix does not contain yet the new value
            {
            case Model.AutoFixType.None:
                WndCreateHook.UnregisterHook();
                WndPolling.Disable();
                break;

            case Model.AutoFixType.WindowsHook:
                RefreshApps(true);
                WndCreateHook.RegisterHook(hwnd);
                WndPolling.Disable();
                break;

            case Model.AutoFixType.WindowPolling:
                RefreshApps(true);
                WndCreateHook.UnregisterHook();
                WndPolling.Enable();
                break;

            case Model.AutoFixType.All:
                RefreshApps(true);
                WndCreateHook.RegisterHook(hwnd);
                WndPolling.Enable();
                break;
            }
        }
 private void AutoFix_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     //Model.AutoFixType field = (Model.AutoFixType)e.AddedItems[0];
     Model.AutoFixType field = HelperLib.Presentation.EnumListConverter.GetItem <Model.AutoFixType>((string)e.AddedItems[0]);
     ((App)Application.Current).AutoFixUpdate(field, Hwnd);
 }