public ShaderLabVariableReferenceAutomaticCompletionStrategy(ShaderLabIntellisenseManager shaderLabIntellisenseManager, ISettingsStore settingsStore) { myShaderLabIntellisenseManager = shaderLabIntellisenseManager; myScalarEntry = settingsStore.Schema.GetScalarEntry((ShaderLabAutopopupEnabledSettingsKey key) => key.InVariableReferences); }
private void SetNumericUpDownBinding <TSettings>( [NotNull] Expression <Func <TSettings, int> > settingAccessor, [NotNull] NumericUpDown numericUpDown, [CanBeNull] CheckBoxDisabledNoCheck2 parentCheckBox) { SettingsScalarEntry entry = _context.Schema.GetScalarEntry(settingAccessor); _context.SetBinding <int>(_lifetime, entry, numericUpDown, NumericUpDown.ValueProperty); SetAssociatedLabel(numericUpDown, entry.Description); parentCheckBox?.IsAppearingChecked.FlowInto(_lifetime, numericUpDown, IsEnabledProperty); }
private void SetAttributesArgumentsCheckBoxBinding <TSettings>( [NotNull] Expression <Func <TSettings, bool> > settingAccessor, [NotNull] CheckBoxDisabledNoCheck2 checkBox, [NotNull] ComboBox parentComboBox) { SettingsScalarEntry entry = _context.Schema.GetScalarEntry(settingAccessor); ConfigureCheckBox(checkBox, "with arguments", entry); IProperty <object> selectedValueProperty = DependencyPropertyWrapper.Create <object>(_lifetime, parentComboBox, Selector.SelectedValueProperty, true); selectedValueProperty.FlowInto(_lifetime, checkBox, IsEnabledProperty, value => HasAttributesArguments((AttributesDisplayKind)value)); }
private void SetCheckBoxBinding <TSettings>([NotNull] Expression <Func <TSettings, bool> > settingAccessor, [NotNull] CheckBoxDisabledNoCheck2 checkBox, [CanBeNull] CheckBoxDisabledNoCheck2 parentCheckbox) { SettingsScalarEntry entry = _context.Schema.GetScalarEntry(settingAccessor); if (checkBox.Content == null) { checkBox.Content = entry.Description; } _context.SetBinding <bool>(_lifetime, entry, checkBox, CheckBoxDisabledNoCheck2.IsCheckedLogicallyDependencyProperty); if (parentCheckbox != null) { parentCheckbox.IsCheckedLogically.FlowInto(_lifetime, checkBox, IsEnabledProperty); } }
private void SetComboBoxBinding <TSettings, TEnum>( [NotNull] Expression <Func <TSettings, TEnum> > settingAccessor, [NotNull] ComboBox comboBox, [CanBeNull] CheckBoxDisabledNoCheck2 parentCheckBox) { comboBox.ItemsSource = CreateEnumItemsSource(typeof(TEnum)); comboBox.DisplayMemberPath = nameof(EnumValue.Description); comboBox.SelectedValuePath = nameof(EnumValue.Value); SettingsScalarEntry entry = _context.Schema.GetScalarEntry(settingAccessor); _context.SetBinding <object>(_lifetime, entry, comboBox, Selector.SelectedValueProperty); SetAssociatedLabel(comboBox, entry.Description); parentCheckBox?.IsAppearingChecked.FlowInto(_lifetime, comboBox, IsEnabledProperty); }
private void SetCheckBoxBinding <TSettings>( [NotNull] Expression <Func <TSettings, bool> > settingAccessor, [NotNull] CheckBoxDisabledNoCheck2 checkBox, [CanBeNull] CheckBoxDisabledNoCheck2 parentCheckBox, bool addColonToDescription = false) { SettingsScalarEntry entry = _context.Schema.GetScalarEntry(settingAccessor); string description = entry.Description; if (addColonToDescription) { description += ":"; } ConfigureCheckBox(checkBox, description, entry); parentCheckBox?.IsAppearingChecked.FlowInto(_lifetime, checkBox, IsEnabledProperty); }
/// <summary> /// Initializes a new instance of the <see cref="IntSliderViewModel"/> class. /// </summary> /// <param name="lifetime"> /// The lifetime of the view model /// </param> /// <param name="context"> /// The settings context /// </param> /// <param name="settingsScalarEntry"> /// The settings entry this view model is bound to /// </param> /// <param name="text"> /// The text to display for this option /// </param> /// <param name="minValue"> /// The minimum allowed value /// </param> /// <param name="maxValue"> /// The maximum allowed value /// </param> /// <param name="minValueText"> /// The text to be displayed next to the lower end of the slider /// </param> /// <param name="maxValueText"> /// The text to be displayed next to the upper end of the slider /// </param> /// <param name="toolTipText"> /// The text to be shown in a tooltip. If left null, defaults to the description of the bound settings entry /// </param> public IntSliderViewModel( Lifetime lifetime, IContextBoundSettingsStoreLive context, SettingsScalarEntry settingsScalarEntry, string text, int minValue, int maxValue, string minValueText, string maxValueText, string toolTipText) { this.Text = text; this.MinValue = minValue; this.MaxValue = maxValue; this.MinValueText = minValueText; this.MaxValueText = maxValueText; this.ToolTipText = toolTipText ?? settingsScalarEntry.Description; this.IntProperty = new Property<int>(lifetime, "IntProperty"); this.IsEnabledProperty = new Property<bool>(lifetime, "IntProperty") { Value = true }; context.SetBinding(lifetime, settingsScalarEntry, this.IntProperty); }
private void SetComboBoxBinding <TSettings, TEnum>([NotNull] Expression <Func <TSettings, TEnum> > settingAccessor, [NotNull] ComboBox comboBox, [CanBeNull] CheckBoxDisabledNoCheck2 parentCheckbox) { comboBox.ItemsSource = CreateEnumItemsSource(typeof(TEnum)); comboBox.DisplayMemberPath = "Description"; comboBox.SelectedValuePath = "Value"; SettingsScalarEntry entry = _context.Schema.GetScalarEntry(settingAccessor); _context.SetBinding <object>(_lifetime, entry, comboBox, Selector.SelectedValueProperty); Label label = FindAssociatedLabel(comboBox); if (label != null && label.Content == null) { label.Content = entry.Description + ":"; } if (parentCheckbox != null) { parentCheckbox.IsCheckedLogically.FlowInto(_lifetime, comboBox, IsEnabledProperty); } }
private void ConfigureCheckBox([NotNull] CheckBoxDisabledNoCheck2 checkBox, [NotNull] string content, [NotNull] SettingsScalarEntry entry) { if (checkBox.Content == null) { checkBox.Content = content; } _keywords.Add(new OptionsPageKeyword(content)); _context.SetBinding <bool>(_lifetime, entry, checkBox, CheckBoxDisabledNoCheck2.IsCheckedLogicallyDependencyProperty); SearchablePageBehavior.SetSearchFilter(checkBox, true); }
public Bootstrap3CompletionStrategy(ISettingsStore settingsStore) { _settingsScalarEntry = settingsStore.Schema.GetScalarEntry <HtmlAutopopupEnabledSettingsKey, AutopopupType>( key => key.OnIdentifiers); }
public NTriplesAutomaticStrategy(ISettingsStore settingsStore) { this.mySettingsScalarEntry = settingsStore.Schema.GetScalarEntry((NTriplesAutopopupEnabledSettingsKey key) => key.OnIdent); }
public AutopopupInDirective([NotNull] ISettingsStore settingsStore) { _settingsEntry = settingsStore.Schema.GetScalarEntry <T4AutopopupSettingsKey, AutopopupType>(key => key.InDirectives); }
public PsiAutomaticStrategy(PsiIntellisenseManager psiIntellisenseManager, ISettingsStore settingsStore) { myPsiIntellisenseManager = psiIntellisenseManager; mySettingsScalarEntry = settingsStore.Schema.GetScalarEntry((PsiAutopopupEnabledSettingsKey key) => key.OnIdent); }
public AutopopupInDirective([NotNull] ISettingsStore settingsStore) { _settingsEntry = settingsStore.Schema.GetScalarEntry<T4AutopopupSettingsKey, AutopopupType>(key => key.InDirectives); }
public ComplexityAnalysisInvalidateOnThresholdChange(Lifetime lifetime, IDaemon daemon, ISettingsStore settingsStore) { SettingsScalarEntry thresholdEntry = settingsStore.Schema.GetScalarEntry((ComplexityAnalysisSettings s) => s.Threshold); settingsStore.AdviseChange(lifetime, thresholdEntry, daemon.Invalidate); }