public ReSharperHelpersOptionsPage(Lifetime lifetime, [NotNull] OptionsPageContext optionsPageContext, [NotNull] OptionsSettingsSmartContext settingsSmart) :
            base(lifetime, optionsPageContext, settingsSmart)
        {
            this.AddControl(
                BeControls
                .GetGrid(
                    GridOrientation.Vertical,
                    (BeControls.GetSpacer(), BeSizingType.Fit),
                    (BeControls.GetRichText("It's recommended to save project specific settings to .editorconfig file instead of configuring them here."), BeSizingType.Fit),
                    (BeControls.GetLinkButton("Read documentation", lifetime, () => Process.Start("https://github.com/zvirja/ReSharperHelpers#editor-config")), BeSizingType.Fit),
                    (BeControls.GetSpacer(), BeSizingType.Fit)
                    )
                .WithColor(Color.LightYellow)
                .InGroupBox("⚠ Use Editor Config")
                );
            this.AddSpacer();

            var projectNameProperty = settingsSmart.GetValueProperty(lifetime, (ReSharperHelperSettings settings) => settings.TestsProjectName);

            this.AddHeader("Test project name [deprecated, use .editorconfig]");
            this.AddControl(projectNameProperty.GetBeTextBox(lifetime));
            this.AddRichText(new RichText()
                             .AppendLine("This setting is used to explicitly specify single project in solution where all unit tests are located.")
                             .Append("The setting has less priority than ")
                             .Append("[assembly: AssemblyMetadata(\"ReSharperHelpers.TestProject\", \"<name>\")]) ", new TextStyle(FontStyle.Italic))
                             .Append("project attribute.", TextStyle.Default).AppendLine()
                             .Append("Save it to .editorconfig file instead", new TextStyle(FontStyle.Bold)).AppendLine()
                             );
            this.AddSpacer();

            var testClassNameSuffix = settingsSmart.GetValueProperty(lifetime, (ReSharperHelperSettings settings) => settings.TestClassNameSuffix);

            this.AddHeader("New test class name suffix");
            this.AddControl(testClassNameSuffix.GetBeTextBox(lifetime));
            this.AddRichText(new RichText()
                             .AppendLine("This setting specifies test class name suffix that should be used for the new tests.")
                             .Append("Consider saving this setting to .editorconfig file or solution specific layer.", new TextStyle(FontStyle.Italic)));

            this.AddSpacer();

            var validTestClassNameSuffixes = settingsSmart.GetValueProperty(lifetime, (ReSharperHelperSettings settings) => settings.ValidTestClassNameSuffixes);

            this.AddHeader("Existing test class name suffixes");
            this.AddControl(validTestClassNameSuffixes.GetBeTextBox(lifetime));
            this.AddRichText(new RichText()
                             .AppendLine("This setting defines additional test suffixes valid for discovering the existing test classes.")
                             .AppendLine("Suffixes should be delimited by comma (e.g. value1,value2).")
                             .Append("Consider saving this setting to .editorconfig file or solution specific layer.", new TextStyle(FontStyle.Italic)));
        }
Example #2
0
 public override BeControl GetPageContent()
 {
     return(BeControls.GetRichText(
                "Please ensure the project is saved in the Unity Editor, or any changes will be lost.", true));
 }
 public override BeControl GetPageContent()
 {
     return(BeControls.GetRichText(GetText(), wrap: true));
 }