Example #1
0
        public CopyFqnProvidersOptionsPage(
            Lifetime lifetime,
            OptionsPageContext optionsPageContext,
            OptionsSettingsSmartContext optionsSettingsSmartContext) : base(lifetime, optionsPageContext, optionsSettingsSmartContext)
        {
            AddText("\"Copy Fully-qualified name/ Source browser URI to Clipboard\" will be extended by the following entries.");

            AddSpacer();

            AddBoolOption((CopyFqnProvidersSettings s) => s.EnableShortNames, "Short names");

            AddSpacer();

            AddText("URL templates:");

            // Use BeControls.GetTextControl() + manual Bind() instead of GetBeTextBox() to support multi-line
            // editing (no handling of the "Enter" key). Just like the `ReSpellerSettingsPage`.

            var textControl = BeControls.GetTextControl(isReadonly: false);

            OptionsSettingsSmartContext
            .GetValueProperty(Lifetime, (CopyFqnProvidersSettings s) => s.UrlTemplates)
            .Bind(Lifetime, textControl.Text);

            AddControl(textControl);
        }
Example #2
0
        private void CreateRichTextExceptionTypesAsHint(Lifetime lifetime, IContextBoundSettingsStoreLive storeOptionsTransactionContext)
        {
            IProperty <string> property = new Property <string>(lifetime, "Exceptional::ExceptionTypesAsHint::ExceptionTypes");

            property.SetValue(storeOptionsTransactionContext.GetValue((Settings.ExceptionalSettings key) => key.OptionalExceptions2));

            property.Change.Advise(lifetime, a =>
            {
                if (!a.HasNew)
                {
                    return;
                }

                storeOptionsTransactionContext.SetValue((Settings.ExceptionalSettings key) => key.OptionalExceptions2, a.New);
            });

            var textControl = BeControls.GetTextControl(isReadonly: false);

            textControl.Text.SetValue(property.GetValue());
            textControl.Text.Change.Advise(lifetime, str =>
            {
                storeOptionsTransactionContext.SetValue((Settings.ExceptionalSettings key) => key.OptionalExceptions2, str);
            });

            AddControl(textControl);
        }
        public TodoItemsCountOptionsPage(
            Lifetime lifetime,
            OptionsPageContext optionsPageContext,
            OptionsSettingsSmartContext optionsSettingsSmartContext) : base(lifetime, optionsPageContext, optionsSettingsSmartContext)
        {
            AddBoolOption((TodoItemsCountSettings s) => s.IsEnabled, "Enabled");

            AddText("Definitions:");

            // Use BeControls.GetTextControl() + manual Bind() instead of GetBeTextBox() to support multi-line
            // editing (no handling of the "Enter" key). Just like the `ReSpellerSettingsPage`.

            var textControl = BeControls.GetTextControl(isReadonly: false);

            OptionsSettingsSmartContext
            .GetValueProperty(Lifetime, (TodoItemsCountSettings s) => s.Definitions)
            .Bind(Lifetime, textControl.Text);

            AddBinding(textControl, BindingStyle.IsEnabledProperty, (TodoItemsCountSettings s) => s.IsEnabled, x => x);

            AddControl(textControl);
            AddText("Syntax: <To-do title>[<Optional text-matching used to filter the counted items>]");
        }