├── .gitignore ├── LICENSE ├── README.md ├── guidance ├── AspxToBlazorConverterFile.md ├── BundlingConfigFactoryFile.md ├── ControlConverterBaseFile.md ├── ConverterAdapterFile.md ├── DialogExtensionsFile.md ├── Guidance.md ├── IControlConverterFile.md ├── IMigrationStatusUpdateFile.md ├── ITagControlConverterFile.md ├── LogicCodeFactoryFile.md ├── MessageTypeEnumFile.md ├── MigrateWebFormCommand.md ├── MigrateWebFormDialogFile.md ├── MigrationExtensionMethodsFile.md ├── MigrationStatusEnumFile.md ├── MigrationStepEnumFile.md ├── MigrationStepStatusFile.md ├── ModuleFactoryFile.md ├── PageCodeBehindFile.md ├── SetupBlazorDialogFile.md ├── SetupBlazorProjectCommand.md ├── WebFormToBlazorServerMigrationAspxFileFile.md ├── WebFormToBlazorServerMigrationBundlingFile.md ├── WebFormToBlazorServerMigrationConfigFile.md ├── WebFormToBlazorServerMigrationFile.md ├── WebFormToBlazorServerMigrationHttpModulesFile.md ├── WebFormToBlazorServerMigrationLogicFile.md ├── WebFormToBlazorServerMigrationStartupFile.md ├── WebFormToBlazorServerMigrationStaticFilesFile.md └── images │ ├── AddNewBlazorProject.png │ ├── AddNewCommand.png │ ├── CodeFactoryHowItWorks.vsdx │ ├── CommandsLoaded.png │ ├── ContextCommand.png │ ├── ExecuteSignature.png │ ├── MigrateToBlazorContextMenu.png │ ├── New-Project.png │ ├── PlaceHolder.png │ ├── SetupBlazorProjectContextMenu.png │ ├── T4Factory.png │ ├── UsageOverview.png │ ├── WebFormExample.png │ ├── WingTipToysRoot.png │ ├── cfxactivity.png │ ├── cfxloadactivity.png │ ├── cfxpackageactivity.png │ ├── commandactivity.png │ └── logo.png ├── package └── WebFormsToBlazorServerCommands.cfx └── src ├── Guidance.md ├── WebFormsToBlazorServer.sln └── WebFormsToBlazorServerCommands ├── Commands ├── Document │ └── MigrateWebForm.cs └── Project │ └── SetupBlazorProject.cs ├── Dialogs ├── DialogExtensions.cs ├── MigrateWebForm.xaml ├── MigrateWebForm.xaml.cs ├── MigrationStepStatus.cs ├── SetupBlazorDialog.xaml └── SetupBlazorDialog.xaml.cs ├── Migration ├── Adapters │ ├── AspxToBlazorControlConverter.cs │ └── ControlConverterBase.cs ├── IControlConverter.cs ├── IMigrationStatusUpdate.cs ├── ITagControlConverter.cs ├── MessageTypeEnum.cs ├── MigrationExtensionMethods.cs ├── MigrationStatusEnum.cs ├── MigrationStepEnum.cs ├── MigrationSteps.cs ├── WebFormToBlazorServerMigration.AspxFiles.cs ├── WebFormToBlazorServerMigration.Bundling.cs ├── WebFormToBlazorServerMigration.Config.cs ├── WebFormToBlazorServerMigration.HttpModules.cs ├── WebFormToBlazorServerMigration.Logic.cs ├── WebFormToBlazorServerMigration.Startup.cs ├── WebFormToBlazorServerMigration.StaticFiles.cs └── WebFormToBlazorServerMigration.cs ├── Properties └── AssemblyInfo.cs ├── Templates ├── BundleConfigFactory.cs ├── BundleConfigFactory.transform.cs ├── BundleConfigFactory.tt ├── LogicCodeFactory.cs ├── LogicCodeFactory.transform.cs ├── LogicCodeFactory.tt ├── MiddlewareConversion.cs ├── MiddlewareConversion.transform.cs ├── MiddlewareConversion.tt ├── ModuleFactory.cs ├── ModuleFactory.transform.cs ├── ModuleFactory.tt ├── PageCodeBehind.cs ├── PageCodeBehind.transform.cs └── PageCodeBehind.tt └── WebFormsToBlazorServerCommands.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 CodeFactoryLLC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WebForms2BlazorServer Automation Template - Out of Date and Support 2 | This project was a early technology demonstrator for the capabilties of **CodeFactory**. This code base used an older version of the runtime and the SDK. These versions are out date and the project will be moved into our support technologies for **CodeFactory** in the future. All of our support packages can be found at the following link. 3 | - [CodeFactoryPackage](https://github.com/CodeFactoryLLC/CodeFactoryPackages) 4 | -------------------------------------------------------------------------------- /guidance/AspxToBlazorConverterFile.md: -------------------------------------------------------------------------------- 1 | # AspxToBlazorConverter.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/BundlingConfigFactoryFile.md: -------------------------------------------------------------------------------- 1 | # AspxToBlazorConverter.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/ControlConverterBaseFile.md: -------------------------------------------------------------------------------- 1 | # ControlConverterBase.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/ConverterAdapterFile.md: -------------------------------------------------------------------------------- 1 | # ConverterAdapter.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/DialogExtensionsFile.md: -------------------------------------------------------------------------------- 1 | # DialogExtensions.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/Guidance.md: -------------------------------------------------------------------------------- 1 | # WebFormsToBlazorServer Guidance 2 | This set of documentation goes into the details of the example CodeFactory Code Automation Template **WebFormsToBlazor**. If you need explainations of what a Code Automation Template is or how CodeFactory works please use the following link to that documentation. [CodeFactory Guidance](http://docs.codefactory.software/guidance/intro.html) 3 | 4 | ## Template Overview 5 | In order to make use of this template you will need to have a target WebForms solution, in our examples below we reference the [*WingTipToys*](https://github.com/corn-pivotal/wingtiptoys) project. This is an older reference project that is freely available to anyone who wished to download it and give this template a try. Once you have your project open inside of Visual Studio - go ahead and add a new Project to the solution of type Blazor - Server. 6 | 7 | ![](./images/AddNewBlazorProject.png) 8 | 9 | The compiled output of the WebFormsToBlazorServer project, a file called *WebFormsToBlazorServerCommands.cfx* file just needs to be dropped into the root solution folder of the WebForms project. 10 | 11 | ![](./images/WingTipToysRoot.png) 12 | 13 | The next time that you open the WingTipToys solution the CodeFactory runtime will [load](http://docs.codefactory.software/guidance/usage-intro.html#consume-the-automation-template) the package and make the command available for use. 14 | 15 | ## Commands 16 | There are currently two(2) commands that have been built inside of the project; 17 | 18 | - SetupBlazorProject 19 | - MigrateWebForm 20 | 21 | The first command, *SetupBlazorProject*, is an implementation of a [Project Command](http://docs.codefactory.software/guidance/overview-commands-intro.html) type and can be found by right-clicking on the Blazor project in your solution. The command is found at the bottom of the context menu. 22 | 23 | ![](./images/SetupBlazorProjectContextMenu.png) 24 | 25 | The second command, *MigrateWebForm*, is an implementation of a [Project Document Command](http://docs.codefactory.software/guidance/overview-commands-intro.html) type and can be found by right-clicking on any *.aspx file that is found in the *WingTipToys* project. 26 | 27 | ![](./images/MigrateToBlazorContextMenu.png) 28 | 29 | ## Project Structure 30 | The following folders are found in this project. 31 | 32 | ### Commands 33 | This folder is further broken down into command type folders. Please click on each item found below to get further details. 34 | #### Document 35 | Name | Description 36 | -----|------- 37 | MigrateWebForm.cs | This is a [Project Document](http://docs.codefactory.software/guidance/overview/commands/projectdocument.html) command type that is built to migrate a single *.aspx file from the source WebForms project into an equivalent Blazor Page Component file in the target Blazor Server project. Please click [here](MigrateWebFormCommand.md) for more details 38 | 39 | #### Project 40 | Name | Description 41 | -----|------- 42 | SetupBlazorProject.cs | This is a [Project](http://docs.codefactory.software/guidance/overview/commands/project.html) command type that will allow a developer to bulk-migrate an **entire** WebForms appliction including all of its logic, configuration and static assets into a Blazor Server application. Please click [here](SetupBlazorProjectCommand.md) for more details. 43 | ### Dialogs 44 | Name | Description 45 | -----|------- 46 | DialogExtensions.cs | This is a standard C# static class that contains a few helper extension methods for dealing with the other two dialogs in the project. Please click [here](DialogExtensionsFile.md) for more details. 47 | MigrateWebForm.xaml/xaml.cs | This is a CodeFactory specific WPF UserControl that is used displayed during the execution of the [Migrate WebForm](MigrateWebFormCommand.md) command. Please click [here](MigrateWebFormDialogFile.md) for more details. 48 | MigrateStepStatus.cs | This is a standard C# POCO object that is used to pass information back to the [MigrateWebForm](MigrateWebFormDialogFile.md) WPF user control in order to be displayed to the developer/user. Please click [here](MigrationStepStatusFile.md) for more details. 49 | SetupBlazorDialg.xaml/xaml.cs | This is a CodeFactory specific WPF UserControl that is displayed during the execution of the [SetupBlazorProject](SetupBlazorProjectCommand.md) command. Please click [here](SetupBlazorDialogFile.md) for more details. 50 | 51 | ### Migration 52 | Name | Description 53 | -----|------- 54 | AspxToBlazorControlConverter.cs | This is a C# class which is the adaptee of the [ConverterAdapter](ConverterAdapterFile.md) class. It understands how to convert WebForms/ASP.NET controls into Blazor equivalents. Please click [here](AspxToBlazorConverterFile.md) for more details. 55 | ControlConverterBase.cs | This is a C# class that all adaptee classes, like the above [AspxToBlazorControlConverter.cs](AspxToBlazorConverterFile.md), inherit from in order to comply with the pattern as implemented by the ConverterAdapter class. Please click [here](ControlConverterBaseFile.md) for more details. 56 | ConverterAdapter.cs | This is the main adapter class that is used by logic found in a number of the methods from the [WebFormToBlazorMigration](WebFormToBlazorServerMigrationFile.md) partial classes definitsion. Please click [here](ConverterAdapterFile.md) for more details. 57 | IControlConverter.cs | This is a standard C# Interface object used by the ControlConverterBase class. Please click [here](IControlConverterFile.md) for more details. 58 | IMigrationStatusUpdate.cs | This is a standard C# Interface object used by the migration logic to pass information back up to both of the dialog classes during exectuion. Please click [here](IMigrationStatusUpdateFile.md) for more details. 59 | ITagControlConverter.cs | This is a standard C# Interface object that defines a single method that is to be implemented by any ControlConverter the is authored. Please click [here](ITagControlConverterFile.md) for more details. 60 | MessageTypeEnum.cs | This is a standard C# Enumeration object that is leveraged during status updates from any migration logic to a running dialog during either of the commands. Please click [here](MessageTypeEnumFile.md) for more details. 61 | MigrationExtensionMethods.cs | This is a standard C# static class that contains several helper methods which are leveraged by migration logic found in other areas of the project. Please click [here](MigrationExtensionMethodsFile.md) for more details. 62 | MigrationStatusEnum.cs | This is a standard C# Enumeration object that is leveraged during status updates from any migration logic to a running dialog during either of the commands. Please click [here](MigrationStatusEnumFile.md) for more details. 63 | MigrationStepEnum.cs | This is a standard C# Enumeration object that is leveraged during status updates from any migration logic to a running dialog during either of the commands. Please click [here](MigrationStepEnumFile.md) for more details. 64 | MigrationSteps.cs | This is a standard C# POCO that holds information on which steps of the [SetupBlazorProject](SetupBlazorProjectCommand.md) command dialog, [SetupBlazorDialog](SetupBlazorDialogFile.md) for more details. 65 | WebFormToBlazorServerMigration.cs | This is a C# *partial* class definition which contains all of the logic for migrating the different parts of a WebForms project into a Blazor Server application. This class is called by the [SetupBlazorDialog](SetupBlazorDialogFile.md) WPF User dialog. Please click [here](WebFormToBlazorServerMigrationFile.md) for more details. 66 | WebFormToBlazorServerMigration.AspxFiles.cs | This is a C# *partial* class definition which contains logic **specific** to the conversion of any *.aspx pages that are found in the source WebForms project. Please click [here](WebFormToBlazorServerMigrationAspxFileFile.md) for more details. 67 | WebFormToBlazorServerMigration.Bundling.cs | This is a C# *partial* class definition which contains logic **specific** to the migration of any scripts that are bundled up in the source WebForms project over to the target Blazor project. Please click [here](WebFormToBlazorServerMigrationBundlingFile.md) for more details. 68 | WebFormToBlazorServerMigration.Config.cs | This is a C# *partial* class definition which contains logic **specific** to the migration of app.config/web.config data that are found in the source WebForms project. Please click [here](WebFormToBlazorServerMigrationConfigFile.md) for more details. 69 | WebFormToBlazorServerMigration.HttpModules.cs | This is a C# *partial* class definition which contains logic **specific** to the migration of any HttpModules that have been customized/defined within the source WebForms project. Please click [here](WebFormToBlazorServerMigrationHttpModulesFile.md) for more details. 70 | WebFormToBlazorServerMigration.Logic.cs | This is a C# *partial* class definition which contains logic **specific** to the migration of any *.cs class documents that are found in the source WebForms project. Please click [here](WebFormToBlazorServerMigrationLogicFile.md) for more details. 71 | WebFormToBlazorServerMigration.Startup.cs | This is a C# *partial* class definition which contains logic **specific** to the migration of the startup.cs code found in the source WebForms project. Please click [here](WebFormToBlazorServerMigrationStartupFile.md) for more details. 72 | WebFormToBlazorServerMigration.StaticFiles.cs | This is a C# *partial* class definition which contains logic **specific** to the migration of any images or script files that are found in the source WebForms project. Please click [here](WebFormToBlazorServerMigrationStaticFilesFile.md) for more details. 73 | 74 | ### Templates 75 | Name | Description 76 | -----|------- 77 | BundleConfigFactory.tt/.cs/transform.cs/ | This is a T4 template that is used to transform and output javascript bundling found in the source WebForms project. Please click [here](BundlingConfigFactoryFile.md) for more details. 78 | LogicCodeFactory.tt/.cs/transform.cs/ | This is a T4 template that is used to transform any of the C# class defintion found in the source WebForms project. Please click [here](LogicCodeFactoryFile.md) for more details. 79 | MiddlewareConversion.tt/.cs/transform.cs/ | **Depricated and not currently in use** 80 | ModuleFactory.tt/.cs/transform.cs/ | This is a T4 template that is used to transform any of the code located within the source WebForms project that inherits from HttpModule. Please click [here](ModuleFactoryFile.md) for more details. 81 | PageCodeBehindFactory.tt/.cs/transform.cs/ | This is a T4 template that is used to output code which is found in any of the *.aspx.cs code-behind file that are found inside of the source WebForms project. Please click [here](PageCodeBehindFile.md) for more details. 82 | -------------------------------------------------------------------------------- /guidance/IControlConverterFile.md: -------------------------------------------------------------------------------- 1 | # IControlConverter.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/IMigrationStatusUpdateFile.md: -------------------------------------------------------------------------------- 1 | # IMigrationStatusUpdate.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/ITagControlConverterFile.md: -------------------------------------------------------------------------------- 1 | # ITagControlConverter.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/LogicCodeFactoryFile.md: -------------------------------------------------------------------------------- 1 | # LogicCodeFactory.tt/.cs/.transform.cs Files 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/MessageTypeEnumFile.md: -------------------------------------------------------------------------------- 1 | # MessageTypeEnum.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/MigrateWebFormCommand.md: -------------------------------------------------------------------------------- 1 | # MigrateWebForm Project Document Command File 2 | 3 | ## Overview 4 | This file, logically, is a CodeFactory [Document Command](http://docs.codefactory.software/guidance/overview-commands-intro.html) and contains all of the logic neccesary for the CodeFactory runtime to call and execute from Visual Studio. There is a single class defined called `public class MigrateWebForm : ProjectDocumentCommandBase` 5 | 6 | ## Fields 7 | The following fields are defined within this class: 8 | 9 | Declaration | Notes 10 | ----------- | ----------- 11 | `private static readonly string commandTitle` | Used to set the title that shows up in the context-menu for the Visual Studio Solution Explorer. 12 | `private static readonly string commandDescription` | Sets a longer descriptive text for the command that shows up in several of the loaded-command windows and diagnostics screens. 13 | 14 | ## Constrcutor 15 | There is a single default constructor that is defined. This constructor should have no logic in it and is responsible for passing back its parameters to its baseclass. 16 | 17 | `public MigrateWebForm(ILogger logger, IVsActions vsActions) : base(logger, vsActions, commandTitle, commandDescription)` 18 | 19 | ## Methods 20 | These are the following methods which are defined within this class file: 21 | 22 | Declaration | Notes 23 | --------- | -------- 24 | `public override async Task EnableCommandAsync(VsProject result)` | Validation logic that will determine if this command should be enabled for execution. 25 | `public override async Task ExecuteCommandAsync(VsProject result)` | Code factory framework calls this method when the command has been executed.
This method creates an instance of the [MigrateWebFormDialog](MigrateWebFormDialogFile.md) and displays it to the user. All migration logic is actually initialized and called from the user control. -------------------------------------------------------------------------------- /guidance/MigrateWebFormDialogFile.md: -------------------------------------------------------------------------------- 1 | # MigrateWebForm.xaml/.xaml.xs Files 2 | 3 | ## Overview 4 | This is a wpf/xaml custom user control definition that is used to display both migration status and gather input from the developer user. 5 | 6 | 7 | ## Fields 8 | 9 | ## Constrcutor 10 | 11 | ## Methods -------------------------------------------------------------------------------- /guidance/MigrationExtensionMethodsFile.md: -------------------------------------------------------------------------------- 1 | # MigrationExtensionMethods.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/MigrationStatusEnumFile.md: -------------------------------------------------------------------------------- 1 | # MigrationStatusEnum.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/MigrationStepEnumFile.md: -------------------------------------------------------------------------------- 1 | # MigrationStepEnum.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/MigrationStepStatusFile.md: -------------------------------------------------------------------------------- 1 | # MigrateSteps.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/ModuleFactoryFile.md: -------------------------------------------------------------------------------- 1 | # ModuleFactory.tt/.transform.cs/.cs Files 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/PageCodeBehindFile.md: -------------------------------------------------------------------------------- 1 | # PageCodeBehind.tt/.transform.cs/.cs Files 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/SetupBlazorDialogFile.md: -------------------------------------------------------------------------------- 1 | # SetupBlazorDialg.xaml/.xaml.cs Files 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/SetupBlazorProjectCommand.md: -------------------------------------------------------------------------------- 1 | # SetupBlazorProject.cs Project Command file 2 | 3 | ## Overview 4 | This file, logically, is a CodeFactory [Project Command](http://docs.codefactory.software/guidance/overview-commands-intro.html) and contains all of the logic neccesary for the CodeFactory runtime to call and execute from Visual Studio. There is a single class defined called `public class MigrateWebForm : ProjectDocumentCommandBase` 5 | 6 | ## Fields 7 | The following fields are defined within this class: 8 | 9 | Declaration | Notes 10 | ----------- | ----------- 11 | `private static readonly string commandTitle` | Used to set the title that shows up in the context-menu for the Visual Studio Solution Explorer. 12 | `private static readonly string commandDescription` | Sets a longer descriptive text for the command that shows up in several of the loaded-command windows and diagnostics screens. 13 | 14 | ## Constrcutor 15 | There is a single default constructor that is defined. This constructor should have no logic in it and is responsible for passing back its parameters to its baseclass. 16 | 17 | `public SetupBlazorProject(ILogger logger, IVsActions vsActions) : base(logger, vsActions, commandTitle, commandDescription)` 18 | 19 | ## Methods 20 | These are the following methods which are defined within this class file: 21 | 22 | Declaration | Notes 23 | --------- | -------- 24 | `public override async Task EnableCommandAsync(VsProject result)` | Validation logic that will determine if this command should be enabled for execution. 25 | `public override async Task ExecuteCommandAsync(VsProject result)` | Code factory framework calls this method when the command has been executed. -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationAspxFileFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.AspxFiles.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationBundlingFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.Bundling.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationConfigFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.Config.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationHttpModulesFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.HttpModules.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationLogicFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.Logic.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationStartupFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.Startup.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/WebFormToBlazorServerMigrationStaticFilesFile.md: -------------------------------------------------------------------------------- 1 | # WebFormToBlazorServerMigration.StaticFiles.cs File 2 | 3 | ## Overview 4 | 5 | ## Fields 6 | 7 | ## Constrcutor 8 | 9 | ## Methods -------------------------------------------------------------------------------- /guidance/images/AddNewBlazorProject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/AddNewBlazorProject.png -------------------------------------------------------------------------------- /guidance/images/AddNewCommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/AddNewCommand.png -------------------------------------------------------------------------------- /guidance/images/CodeFactoryHowItWorks.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/CodeFactoryHowItWorks.vsdx -------------------------------------------------------------------------------- /guidance/images/CommandsLoaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/CommandsLoaded.png -------------------------------------------------------------------------------- /guidance/images/ContextCommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/ContextCommand.png -------------------------------------------------------------------------------- /guidance/images/ExecuteSignature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/ExecuteSignature.png -------------------------------------------------------------------------------- /guidance/images/MigrateToBlazorContextMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/MigrateToBlazorContextMenu.png -------------------------------------------------------------------------------- /guidance/images/New-Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/New-Project.png -------------------------------------------------------------------------------- /guidance/images/PlaceHolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/PlaceHolder.png -------------------------------------------------------------------------------- /guidance/images/SetupBlazorProjectContextMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/SetupBlazorProjectContextMenu.png -------------------------------------------------------------------------------- /guidance/images/T4Factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/T4Factory.png -------------------------------------------------------------------------------- /guidance/images/UsageOverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/UsageOverview.png -------------------------------------------------------------------------------- /guidance/images/WebFormExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/WebFormExample.png -------------------------------------------------------------------------------- /guidance/images/WingTipToysRoot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/WingTipToysRoot.png -------------------------------------------------------------------------------- /guidance/images/cfxactivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/cfxactivity.png -------------------------------------------------------------------------------- /guidance/images/cfxloadactivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/cfxloadactivity.png -------------------------------------------------------------------------------- /guidance/images/cfxpackageactivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/cfxpackageactivity.png -------------------------------------------------------------------------------- /guidance/images/commandactivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/commandactivity.png -------------------------------------------------------------------------------- /guidance/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/guidance/images/logo.png -------------------------------------------------------------------------------- /package/WebFormsToBlazorServerCommands.cfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeFactoryLLC/WebForms2BlazorServer/1ee93172c78ab7cb61a54243d8cdf5aebdd392b0/package/WebFormsToBlazorServerCommands.cfx -------------------------------------------------------------------------------- /src/Guidance.md: -------------------------------------------------------------------------------- 1 | # WebFormsToBlazorServer Guidance 2 | This guidance document provides an overview for how to understand the implementation of this command library. 3 | 4 | To be updated -------------------------------------------------------------------------------- /src/WebFormsToBlazorServer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33213.308 5 | MinimumVisualStudioVersion = 15.0.26124.0 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebFormsToBlazorServerCommands", "WebFormsToBlazorServerCommands\WebFormsToBlazorServerCommands.csproj", "{2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Debug|x64.ActiveCfg = Debug|Any CPU 21 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Debug|x64.Build.0 = Debug|Any CPU 22 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Debug|x86.ActiveCfg = Debug|Any CPU 23 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Debug|x86.Build.0 = Debug|Any CPU 24 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Release|x64.ActiveCfg = Release|Any CPU 27 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Release|x64.Build.0 = Release|Any CPU 28 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Release|x86.ActiveCfg = Release|Any CPU 29 | {2B1CA33A-0E23-4ED6-97BE-67BFF5737A5A}.Release|x86.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {608D67A6-252F-466D-A5BA-C9CE3310C604} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /src/WebFormsToBlazorServerCommands/Commands/Document/MigrateWebForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.CodeDom.Compiler; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using CodeFactory.Logging; 8 | using CodeFactory.VisualStudio; 9 | using CodeFactory.VisualStudio.SolutionExplorer; 10 | using CodeFactory.Formatting.CSharp; 11 | using WebFormsToBlazorServerCommands.Dialogs; 12 | using System.IO; 13 | 14 | namespace WebFormsToBlazorServerCommands.Commands.Document 15 | { 16 | /// 17 | /// Code factory command for automation of a document when selected from a project in solution explorer. 18 | /// 19 | public class MigrateWebForm : ProjectDocumentCommandBase 20 | { 21 | private static readonly string commandTitle = "Migrate to Blazor"; 22 | private static readonly string commandDescription = "Migrates a single *.aspx page to a Blazor componenet."; 23 | 24 | #pragma warning disable CS1998 25 | 26 | /// 27 | public MigrateWebForm(ILogger logger, IVsActions vsActions) : base(logger, vsActions, commandTitle, commandDescription) 28 | { 29 | //Intentionally blank 30 | } 31 | 32 | #region Overrides of VsCommandBase 33 | 34 | /// 35 | /// Validation logic that will determine if this command should be enabled for execution. 36 | /// 37 | /// The target model data that will be used to determine if this command should be enabled. 38 | /// Boolean flag that will tell code factory to enable this command or disable it. 39 | public override async Task EnableCommandAsync(VsDocument result) 40 | { 41 | //Result that determines if the the command is enabled and visible in the context menu for execution. 42 | bool isEnabled = false; 43 | 44 | try 45 | { 46 | isEnabled = result.Name.Contains("aspx"); 47 | } 48 | catch (Exception unhandledError) 49 | { 50 | _logger.Error($"The following unhandled error occured while checking if the solution explorer project document command {commandTitle} is enabled. ", 51 | unhandledError); 52 | isEnabled = false; 53 | } 54 | 55 | return isEnabled; 56 | } 57 | 58 | /// 59 | /// Code factory framework calls this method when the command has been executed. 60 | /// 61 | /// The code factory model that has generated and provided to the command to process. 62 | public override async Task ExecuteCommandAsync(VsDocument result) 63 | { 64 | try 65 | { 66 | //User Control 67 | var migrateDialog = await VisualStudioActions.UserInterfaceActions.CreateVsUserControlAsync(); 68 | 69 | //Get Project List 70 | var solution = await VisualStudioActions.SolutionActions.GetSolutionAsync(); 71 | 72 | //Set properties on the dialog 73 | var projects = await solution.GetProjectsAsync(false); 74 | migrateDialog.SolutionProjects = projects; 75 | migrateDialog.FormToMigrate = result; 76 | 77 | //Show the dialog 78 | await VisualStudioActions.UserInterfaceActions.ShowDialogWindowAsync(migrateDialog); 79 | 80 | } 81 | catch (Exception unhandledError) 82 | { 83 | _logger.Error($"The following unhandled error occured while executing the solution explorer project document command {commandTitle}. ", 84 | unhandledError); 85 | 86 | } 87 | 88 | } 89 | 90 | 91 | } 92 | 93 | #endregion 94 | } 95 | 96 | -------------------------------------------------------------------------------- /src/WebFormsToBlazorServerCommands/Commands/Project/SetupBlazorProject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using CodeFactory.Logging; 7 | using CodeFactory.VisualStudio; 8 | using CodeFactory.VisualStudio.SolutionExplorer; 9 | using WebFormsToBlazorServerCommands.Dialogs; 10 | 11 | namespace WebFormsToBlazorServerCommands.Commands.Project 12 | { 13 | /// 14 | /// Code factory command for automation of a project when selected from solution explorer. 15 | /// 16 | public class SetupBlazorProject : ProjectCommandBase 17 | { 18 | private static readonly string commandTitle = "Setup Blazor Project"; 19 | private static readonly string commandDescription = "Will setup a blazor project with win form project data."; 20 | 21 | #pragma warning disable CS1998 22 | 23 | /// 24 | public SetupBlazorProject(ILogger logger, IVsActions vsActions) : base(logger, vsActions, commandTitle, commandDescription) 25 | { 26 | //Intentionally blank 27 | } 28 | #pragma warning disable CS1998 29 | #region Overrides of VsCommandBase 30 | 31 | /// 32 | /// Validation logic that will determine if this command should be enabled for execution. 33 | /// 34 | /// The target model data that will be used to determine if this command should be enabled. 35 | /// Boolean flag that will tell code factory to enable this command or disable it. 36 | public override async Task EnableCommandAsync(VsProject result) 37 | { 38 | //Result that determines if the the command is enabled and visible in the context menu for execution. 39 | bool isEnabled = false; 40 | 41 | try 42 | { 43 | var children = await result.GetChildrenAsync(true); 44 | 45 | if (children.Any(p => p.ModelType.Equals(VisualStudioModelType.ProjectFolder) && p.Name.Equals("Pages"))) 46 | { 47 | isEnabled = true; 48 | } 49 | 50 | } 51 | catch (Exception unhandledError) 52 | { 53 | _logger.Error($"The following unhandled error occured while checking if the solution explorer project command {commandTitle} is enabled. ", 54 | unhandledError); 55 | isEnabled = false; 56 | } 57 | 58 | return isEnabled; 59 | } 60 | 61 | /// 62 | /// Code factory framework calls this method when the command has been executed. 63 | /// 64 | /// The code factory model that has generated and provided to the command to process. 65 | public override async Task ExecuteCommandAsync(VsProject result) 66 | { 67 | try 68 | { 69 | //Creating an instance of the setup blazor dialog class. This internally hooks it into the visual studio UI system. 70 | var migrateDialog = await VisualStudioActions.UserInterfaceActions.CreateVsUserControlAsync(); 71 | 72 | //Get Project List 73 | var solution = await VisualStudioActions.SolutionActions.GetSolutionAsync(); 74 | 75 | //Setting the list of solution projects into the dialog. 76 | migrateDialog.SolutionProjects = await solution.GetProjectsAsync(true); 77 | 78 | //Showing the dialog 79 | await VisualStudioActions.UserInterfaceActions.ShowDialogWindowAsync(migrateDialog); 80 | } 81 | catch (Exception unhandledError) 82 | { 83 | _logger.Error($"The following unhandled error occured while executing the solution explorer project command {commandTitle}. ", 84 | unhandledError); 85 | 86 | } 87 | } 88 | 89 | #endregion 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/WebFormsToBlazorServerCommands/Dialogs/DialogExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Media; 9 | using WebFormsToBlazorServerCommands.Migration; 10 | 11 | namespace WebFormsToBlazorServerCommands.Dialogs 12 | { 13 | /// 14 | /// Extensions class that manages data to be used in the dialog. 15 | /// 16 | public static class DialogExtensions 17 | { 18 | /// 19 | /// Check a nullable bool for a value, will return false if the bool is null. 20 | /// 21 | /// Nullable bool to check 22 | /// standard boolean result. 23 | public static bool GetResult(this bool? source) 24 | { 25 | return source.HasValue ? source.Value : false; 26 | } 27 | 28 | /// 29 | /// Extension method used to help format labels that track migration status. Must be executed on the UI Thread. 30 | /// 31 | /// Label to be updated 32 | /// Status type used for formatting. 33 | public static void UpdateMigrationStatus(this TextBlock source, MigrationStatusEnum status) 34 | { 35 | switch (status) 36 | { 37 | case MigrationStatusEnum.Running: 38 | source.FontWeight = FontWeights.Bold; 39 | break; 40 | 41 | case MigrationStatusEnum.Passed: 42 | source.FontWeight = FontWeights.ExtraBold; 43 | source.Foreground = Brushes.Green; 44 | break; 45 | 46 | case MigrationStatusEnum.Failed: 47 | source.FontWeight = FontWeights.ExtraBold; 48 | source.Foreground = Brushes.Red; 49 | break; 50 | 51 | default: 52 | break; 53 | } 54 | } 55 | 56 | /// 57 | /// Gets a title assigned to each migration step. 58 | /// 59 | /// The migration step to be loaded. 60 | /// The title. 61 | public static string GetName(this MigrationStepEnum source) 62 | { 63 | string name = null; 64 | 65 | switch (source) 66 | { 67 | case MigrationStepEnum.Startup: 68 | name = "Startup"; 69 | break; 70 | 71 | case MigrationStepEnum.HttpModules: 72 | name = "Http Modules"; 73 | break; 74 | 75 | case MigrationStepEnum.StaticFiles: 76 | name = "Static Files"; 77 | break; 78 | 79 | case MigrationStepEnum.Bundling: 80 | name = "Bundling"; 81 | break; 82 | 83 | case MigrationStepEnum.AspxPages: 84 | name = "Aspx Pages"; 85 | break; 86 | 87 | case MigrationStepEnum.Config: 88 | name = "Configuration"; 89 | break; 90 | 91 | case MigrationStepEnum.AppLogic: 92 | name = "App Logic"; 93 | break; 94 | 95 | case MigrationStepEnum.MigrationProcess: 96 | name = "Migration Process"; 97 | break; 98 | 99 | } 100 | 101 | return name; 102 | } 103 | 104 | /// 105 | /// Gets a friendly string name for each message type. 106 | /// 107 | /// Message type to process. 108 | /// The friendly name. 109 | public static string GetName(this MessageTypeEnum source) 110 | { 111 | string name = null; 112 | 113 | switch (source) 114 | { 115 | case MessageTypeEnum.Information: 116 | name = "Information"; 117 | break; 118 | 119 | case MessageTypeEnum.Warning: 120 | name = "Warning"; 121 | break; 122 | 123 | case MessageTypeEnum.Error: 124 | name = "Error"; 125 | break; 126 | } 127 | 128 | return name; 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/WebFormsToBlazorServerCommands/Dialogs/MigrateWebForm.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 40 | 41 | 42 | 43 | 44 |