public void CalculateIsControlEnabled() { int EmulationMode = ApplicationSettings.GetInstance().EmulationMode; if (EmulationConstants.IsValidValue(EmulationMode) && EmulationMode == EmulationConstants.ONLY_VIGEM) { Element_Toggle.Visibility = UIConstants.VISIBILITY_COLLAPSED; Element_TextBlock_Description.Visibility = UIConstants.VISIBILITY_COLLAPSED; Element_TextBlock_Warning.Visibility = UIConstants.VISIBILITY_VISIBLE; } else { Element_Toggle.Visibility = UIConstants.VISIBILITY_VISIBLE; Element_TextBlock_Description.Visibility = UIConstants.VISIBILITY_VISIBLE; Element_TextBlock_Warning.Visibility = UIConstants.VISIBILITY_COLLAPSED; } }
public int GetValue() { RadioButton checkedRadioButton = Panel_RadioButtonGroup.Children.OfType <RadioButton>(). Where(n => n.IsChecked == true).First(); if (checkedRadioButton != null && checkedRadioButton.Tag != null) { int tag = Int32.Parse(checkedRadioButton.Tag.ToString()); if (EmulationConstants.IsValidValue(tag)) { Log.Information("EmulationPickerControl tag is " + tag); return(tag); } } Log.Information("EmulationPickerControl tag is null"); return(-1); }
public void SetInitialRadioChecked() { // if vigem is installed there are no restrictions // use the last known setting (assuming the are valid) if (IsVigemInstalled) { int initialTag = ApplicationSettings.GetInstance().EmulationMode; if (EmulationConstants.IsValidValue(initialTag)) { SetRadioCheckedForTag(initialTag); } else { SetRadioCheckedForTag(EmulationConstants.VIGEM_AND_PROCESS_INJECTION); } } // if vigem isnt installed then we can only do process injection else { SetRadioCheckedForTag(EmulationConstants.ONLY_PROCESS_INJECTION); } }