Skip to content

Using Roslyn to build dlls; Dark theme#168

Open
romangolev wants to merge 7 commits intoarchitecture-building-systems:masterfrom
romangolev:master
Open

Using Roslyn to build dlls; Dark theme#168
romangolev wants to merge 7 commits intoarchitecture-building-systems:masterfrom
romangolev:master

Conversation

@romangolev
Copy link
Copy Markdown
Contributor

Purpose

Primary 2 main purposes for this PR:

Description

Add reference to Microsoft.CodeAnalysis.CSharp and use it to build dlls. This is a modern way to emit dlls which is preferable and supports .NET8 and other platforms.

A new Dark theme is now used for the interface if users choses the Revit to be in a Dark mode. It recognizes Revit theme automatically and switches theme for RPS as well
image

Declarations

Check these if you believe they are true

  • This PR fix bug
  • This PR for new feature
  • The codebase is in a better state after this PR
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@daren-thomas

FYIs

@daren-thomas tested for 2022

Copilot AI review requested due to automatic review settings January 15, 2026 23:55
@Ianhuuuuang
Copy link
Copy Markdown

Ianhuuuuang commented Jan 15, 2026 via email

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modernizes the RevitPythonShell project by implementing two major features: using Roslyn for DLL compilation and adding a Dark theme for Revit 2024+. The Roslyn implementation replaces the legacy AssemblyBuilder approach to fix the "Deploy RPS Addin" functionality (issue #167), while the Dark theme automatically matches Revit's UI theme preference.

Changes:

  • Replaced legacy System.Reflection.Emit DLL generation with modern Roslyn (Microsoft.CodeAnalysis.CSharp) for the Deploy RpsAddin command
  • Added comprehensive Dark theme support with automatic detection of Revit's theme preference
  • Refactored resource loading to support fallback from embedded resources to external files

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
RevitPythonShell/RevitCommands/DeployRpsAddinCommand.cs Replaced legacy AssemblyBuilder with Roslyn compilation; resources now saved as separate files
RpsRuntime/RpsExternalCommandBase.cs Added constructor parameter and fallback loading from files when embedded resources unavailable
RpsRuntime/RpsExternalApplicationBase.cs Added fallback resource loading from files
RevitPythonShell/Helpers/ThemeManager.cs New theme manager with Revit theme detection and WPF resource management
RevitPythonShell/Views/IronPythonConsole.xaml Updated UI with custom title bar and theme-aware styling
RevitPythonShell/Themes/*.xaml New Light and Dark theme resource dictionaries
PythonConsoleControl/* Enhanced console control with theme support and improved colorization
RpsRuntime/ScriptOutputStream.cs Improved output buffering using StringBuilder instead of BOM handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread RevitPythonShell/RevitCommands/DeployRpsAddinCommand.cs Outdated
Comment thread RevitPythonShell/RevitCommands/DeployRpsAddinCommand.cs
Comment thread RpsRuntime/RpsExternalCommandBase.cs
Comment thread RevitPythonShell/Views/IronPythonConsole.xaml.cs Outdated
Comment thread RevitPythonShell/Views/IronPythonConsole.xaml.cs Outdated
Comment thread RevitPythonShell/Helpers/ThemeManager.cs
Comment thread RevitPythonShell/Helpers/ThemeManager.cs
Comment thread RevitPythonShell/RevitCommands/DeployRpsAddinCommand.cs
Comment thread RpsRuntime/RpsExternalCommandBase.cs Outdated
Comment thread RevitPythonShell/Helpers/ThemeManager.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants