├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── BlazorStudio.ClassLib ├── BlazorStudio.ClassLib.csproj ├── Clipboard │ ├── ClipboardFacts.cs │ └── ClipboardPhrase.cs ├── CodeAnalysis │ ├── BlazorStudioDiagnosticBag.cs │ └── C │ │ ├── BinderCase │ │ ├── BinderSession.cs │ │ ├── BoundNodes │ │ │ ├── BoundBinaryOperatorNode.cs │ │ │ ├── BoundTypeNode.cs │ │ │ ├── Expression │ │ │ │ ├── BoundBinaryExpressionNode.cs │ │ │ │ ├── BoundLiteralExpressionNode.cs │ │ │ │ └── IBoundExpressionNode.cs │ │ │ └── Statements │ │ │ │ ├── BoundFunctionDeclarationNode.cs │ │ │ │ ├── BoundFunctionInvocationNode.cs │ │ │ │ ├── BoundReturnStatementNode.cs │ │ │ │ ├── BoundVariableAssignmentStatementNode.cs │ │ │ │ └── BoundVariableDeclarationNode.cs │ │ └── BoundScope.cs │ │ ├── EvaluatorCase │ │ ├── Evaluator.cs │ │ └── EvaluatorResult.cs │ │ ├── Facts │ │ ├── CLanguageFacts.Keywords.cs │ │ ├── CLanguageFacts.Main.cs │ │ ├── CLanguageFacts.PreprocessorDirectives.cs │ │ ├── CLanguageFacts.Punctuation.cs │ │ ├── CLanguageFacts.Scope.cs │ │ ├── CLanguageFacts.Types.cs │ │ └── CLanguageFacts.Whitespace.cs │ │ ├── SemanticModelC.cs │ │ ├── SemanticModelResult.cs │ │ ├── Symbols │ │ ├── FunctionSymbol.cs │ │ ├── Symbol.cs │ │ ├── TypeSymbol.cs │ │ └── VariableSymbol.cs │ │ ├── Syntax │ │ ├── ISyntax.cs │ │ ├── LexSession.cs │ │ ├── ParserSession.cs │ │ ├── SyntaxKind.cs │ │ ├── SyntaxNodes │ │ │ ├── CompilationUnit.cs │ │ │ ├── CompilationUnitBuilder.cs │ │ │ ├── Expression │ │ │ │ ├── IExpressionNode.cs │ │ │ │ └── LiteralExpressionNode.cs │ │ │ ├── ISyntaxNode.cs │ │ │ └── Statement │ │ │ │ ├── IStatementNode.cs │ │ │ │ └── PreprocessorDirectiveStatement.cs │ │ ├── SyntaxTokens │ │ │ ├── CloseBraceToken.cs │ │ │ ├── CloseParenthesisToken.cs │ │ │ ├── CommentMultiLineToken.cs │ │ │ ├── CommentSingleLineToken.cs │ │ │ ├── EndOfFileToken.cs │ │ │ ├── EqualsToken.cs │ │ │ ├── ISyntaxToken.cs │ │ │ ├── IdentifierToken.cs │ │ │ ├── KeywordToken.cs │ │ │ ├── LibraryReferenceToken.cs │ │ │ ├── NumericLiteralToken.cs │ │ │ ├── OpenBraceToken.cs │ │ │ ├── OpenParenthesisToken.cs │ │ │ ├── PlusToken.cs │ │ │ ├── PreprocessorDirectiveToken.cs │ │ │ ├── StatementDelimiterToken.cs │ │ │ ├── StringLiteralToken.cs │ │ │ ├── SyntaxTokenHelper.cs │ │ │ └── TriviaToken.cs │ │ └── TokenWalker.cs │ │ └── TextEditorLexerC.cs ├── CommandLine │ ├── DotNetCliFacts.cs │ └── GitCliFacts.cs ├── ComponentRenderers │ ├── BlazorStudioComponentRenderers.cs │ ├── IBlazorStudioComponentRenderers.cs │ └── Types │ │ ├── IDeleteFileFormRendererType.cs │ │ ├── IFileFormRendererType.cs │ │ ├── IGitDisplayRendererType.cs │ │ ├── IInputFileRendererType.cs │ │ ├── INuGetPackageManagerRendererType.cs │ │ ├── IRemoveCSharpProjectFromSolutionRendererType.cs │ │ ├── ITreeViewAbsoluteFilePathRendererType.cs │ │ ├── ITreeViewCSharpProjectToProjectReferenceRendererType.cs │ │ ├── ITreeViewGitFileRendererType.cs │ │ ├── ITreeViewLightWeightNugetPackageRecordRendererType.cs │ │ ├── ITreeViewNamespacePathRendererType.cs │ │ └── ITreeViewSolutionFolderRendererType.cs ├── Context │ ├── ContextFacts.cs │ ├── ContextKey.cs │ └── ContextRecord.cs ├── Dimensions │ └── SizeFacts.cs ├── DotNet │ ├── CSharp │ │ ├── CSharpProject.cs │ │ ├── CSharpProjectDependencies.cs │ │ ├── CSharpProjectNugetPackageReferences.cs │ │ ├── CSharpProjectSyntaxWalker.cs │ │ ├── CSharpProjectToProjectReference.cs │ │ └── CSharpProjectToProjectReferences.cs │ ├── DotNetProjectKind.cs │ ├── DotNetSolution.cs │ ├── DotNetSolutionFacts.cs │ ├── DotNetSolutionFolder.cs │ ├── DotNetSolutionGlobalSection.cs │ ├── DotNetSolutionGlobalSectionTypes │ │ ├── GlobalSectionNestedProjects.cs │ │ └── NestedProjectEntry.cs │ ├── DotNetSolutionParser.cs │ └── IDotNetProject.cs ├── Dto │ ├── InternalResponse.cs │ └── InternalResponseVoid.cs ├── FileConstants │ ├── ExtensionNoPeriodFacts.cs │ ├── HiddenFileFacts.cs │ └── UniqueFileFacts.cs ├── FileSystem │ ├── Classes │ │ ├── FilePath │ │ │ ├── AbsoluteFilePath.cs │ │ │ ├── AbsoluteFilePathStringValue.cs │ │ │ ├── FilePathHelper.cs │ │ │ ├── FilePathType.cs │ │ │ ├── FileSystemDrive.cs │ │ │ ├── PathFormatter.cs │ │ │ └── RelativeFilePath.cs │ │ ├── Local │ │ │ ├── LocalDirectoryHandler.cs │ │ │ ├── LocalEnvironmentProvider.cs │ │ │ ├── LocalFileHandler.cs │ │ │ └── LocalFileSystemProvider.cs │ │ └── Website │ │ │ ├── WebsiteDirectoryHandler.cs │ │ │ ├── WebsiteEnvironmentProvider.cs │ │ │ ├── WebsiteFileHandler.cs │ │ │ └── WebsiteFileSystemProvider.cs │ └── Interfaces │ │ ├── AbsoluteFilePathKind.cs │ │ ├── IAbsoluteFilePath.cs │ │ ├── IDirectoryHandler.cs │ │ ├── IEnvironmentProvider.cs │ │ ├── IFileHandler.cs │ │ ├── IFilePath.cs │ │ ├── IFileSystemDrive.cs │ │ ├── IFileSystemProvider.cs │ │ ├── IRelativeFilePath.cs │ │ └── README.md ├── FileTemplates │ ├── FileTemplate.cs │ ├── FileTemplateFacts.cs │ ├── FileTemplateKind.cs │ ├── FileTemplateParameter.cs │ ├── FileTemplateProvider.cs │ ├── FileTemplateResult.cs │ ├── IFileTemplate.cs │ └── IFileTemplateProvider.cs ├── Git │ ├── GitDirtyReason.cs │ ├── GitFacts.cs │ └── GitFile.cs ├── Html │ ├── HtmlFacts.Button.cs │ ├── HtmlFacts.Main.cs │ └── HtmlHelper.cs ├── InputFile │ └── InputFilePattern.cs ├── Menu │ ├── CommonMenuOptionsFactory.cs │ └── ICommonMenuOptionsFactory.cs ├── Namespaces │ └── NamespacePath.cs ├── Nuget │ ├── INugetPackageManagerProvider.cs │ ├── INugetPackageManagerQuery.cs │ ├── LightWeightNugetPackageRecord.cs │ ├── NugetPackageManagerProviderAzureSearchUsnc.cs │ ├── NugetPackageRecord.cs │ ├── NugetPackageVersionRecord.cs │ └── NugetResponse.cs ├── Panel │ ├── PanelFacts.cs │ ├── PanelRecord.cs │ ├── PanelRecordKey.cs │ ├── PanelTab.cs │ └── PanelTabKey.cs ├── ServiceCollectionExtensions.cs ├── State │ └── StateKey.cs ├── Store │ ├── ContextCase │ │ ├── ContextStates.cs │ │ ├── ContextStatesReducer.cs │ │ └── SetActiveContextRecordsAction.cs │ ├── CounterCase │ │ ├── CounterState.cs │ │ ├── CounterStateReducer.cs │ │ └── IncrementCounterStateAction.cs │ ├── DotNetSolutionCase │ │ ├── DotNetSolutionState.Actions.cs │ │ ├── DotNetSolutionState.Main.cs │ │ └── DotNetSolutionState.Reducer.cs │ ├── EditorCase │ │ └── EditorState.cs │ ├── FileSystemCase │ │ ├── FileSystemState.Actions.cs │ │ └── FileSystemState.Effector.cs │ ├── FolderExplorerCase │ │ ├── FolderExplorerState.cs │ │ ├── FolderExplorerStateReducer.cs │ │ └── SetFolderExplorerStateAction.cs │ ├── FooterCase │ │ └── FooterState.cs │ ├── GitCase │ │ ├── GitState.Actions.cs │ │ ├── GitState.Effector.cs │ │ ├── GitState.Main.cs │ │ ├── GitState.Reducer.cs │ │ └── GitTask.cs │ ├── InputFileCase │ │ ├── InputFileState.Actions.cs │ │ ├── InputFileState.Common.cs │ │ ├── InputFileState.Effector.cs │ │ ├── InputFileState.Main.cs │ │ └── InputFileState.Reducer.cs │ ├── LocalStorageCase │ │ └── LocalStorageEffects.cs │ ├── NugetPackageManagerCase │ │ ├── NuGetPackageManagerState.Actions.cs │ │ ├── NuGetPackageManagerState.Main.cs │ │ └── NuGetPackageManagerState.Reducer.cs │ ├── PanelCase │ │ ├── PanelsCollection.Actions.cs │ │ ├── PanelsCollection.Main.cs │ │ └── PanelsCollection.Reducer.cs │ ├── ProgramExecutionCase │ │ ├── ProgramExecutionState.cs │ │ └── ProgramExecutionStateReducer.cs │ └── TerminalCase │ │ ├── TerminalCommand.cs │ │ ├── TerminalCommandKey.cs │ │ ├── TerminalSession.cs │ │ ├── TerminalSessionFacts.cs │ │ ├── TerminalSessionKey.cs │ │ ├── TerminalSessionWasModifiedState.cs │ │ ├── TerminalSessionWasModifiedStateReducer.cs │ │ ├── TerminalSessionsReducer.cs │ │ ├── TerminalSessionsState.cs │ │ ├── WellKnownTerminalSessionsState.cs │ │ └── WellKnownTerminalSessionsStateReducer.cs ├── TreeViewImplementations │ ├── Helper │ │ ├── TreeViewHelper.CSharpProject.cs │ │ ├── TreeViewHelper.Directory.cs │ │ ├── TreeViewHelper.DotNetSolution.cs │ │ ├── TreeViewHelper.Main.cs │ │ └── TreeViewHelper.RazorMarkup.cs │ ├── TreeViewAbsoluteFilePath.cs │ ├── TreeViewCSharpProjectDependencies.cs │ ├── TreeViewCSharpProjectNugetPackageReferences.cs │ ├── TreeViewCSharpProjectToProjectReference.cs │ ├── TreeViewCSharpProjectToProjectReferences.cs │ ├── TreeViewGitFile.cs │ ├── TreeViewLightWeightNugetPackageRecord.cs │ ├── TreeViewNamespacePath.cs │ ├── TreeViewSolution.cs │ └── TreeViewSolutionFolder.cs └── Views │ ├── View.cs │ ├── ViewFacts.cs │ ├── ViewKey.cs │ └── ViewKind.cs ├── BlazorStudio.Photino ├── App.razor ├── BlazorStudio.Photino.csproj ├── Program.cs ├── _Imports.razor ├── favicon.ico └── wwwroot │ ├── css │ ├── bootstrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── open-iconic │ │ ├── FONT-LICENSE │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ └── site.css │ └── index.html ├── BlazorStudio.RazorLib ├── Account │ ├── LoginFormDisplay.razor │ └── LoginFormDisplay.razor.cs ├── Adhoc │ ├── AdhocDisplay.razor │ └── AdhocDisplay.razor.cs ├── BlazorStudio.RazorLib.csproj ├── BlazorStudioInitializer.razor ├── BlazorStudioInitializer.razor.cs ├── BlazorStudioOptions.cs ├── Button │ ├── ButtonDisplay.razor │ └── ButtonDisplay.razor.cs ├── CSharpProjectForm │ ├── CSharpProjectFormDisplay.razor │ ├── CSharpProjectFormDisplay.razor.cs │ ├── RemoveCSharpProjectFromSolutionDisplay.razor │ └── RemoveCSharpProjectFromSolutionDisplay.razor.cs ├── ContextCase │ ├── ContextBoundary.razor │ └── ContextBoundary.razor.cs ├── CounterCase │ ├── CounterDisplay.razor │ └── CounterDisplay.razor.cs ├── DotNetSolutionForm │ ├── DotNetSolutionFormDisplay.razor │ └── DotNetSolutionFormDisplay.razor.cs ├── Editor │ ├── EditorDisplay.razor │ └── EditorDisplay.razor.cs ├── File │ ├── DeleteFileFormDisplay.razor │ ├── DeleteFileFormDisplay.razor.cs │ ├── FileFormDisplay.razor │ ├── FileFormDisplay.razor.cs │ ├── FileIconDisplay.razor │ ├── FileIconDisplay.razor.cs │ ├── FileTemplatesDisplay.razor │ └── FileTemplatesDisplay.razor.cs ├── FolderExplorer │ ├── Classes │ │ ├── FolderExplorerTreeViewKeyboardEventHandler.cs │ │ └── FolderExplorerTreeViewMouseEventHandler.cs │ ├── FolderExplorerDisplay.razor │ ├── FolderExplorerDisplay.razor.cs │ └── InternalComponents │ │ ├── FolderExplorerContextMenu.razor │ │ └── FolderExplorerContextMenu.razor.cs ├── FormsGeneric │ ├── BooleanPromptOrCancelDisplay.razor │ └── BooleanPromptOrCancelDisplay.razor.cs ├── Git │ ├── GitChangesDisplay.razor │ └── GitChangesDisplay.razor.cs ├── InputFile │ ├── Classes │ │ ├── InputFileTreeViewKeyboardEventHandler.cs │ │ └── InputFileTreeViewMouseEventHandler.cs │ ├── InputFileDisplay.razor │ ├── InputFileDisplay.razor.cs │ └── InternalComponents │ │ ├── InputFileAddressHierarchyEntry.razor │ │ ├── InputFileAddressHierarchyEntry.razor.cs │ │ ├── InputFileBottomControls.razor │ │ ├── InputFileBottomControls.razor.cs │ │ ├── InputFileContent.razor │ │ ├── InputFileContent.razor.cs │ │ ├── InputFileContextMenu.razor │ │ ├── InputFileContextMenu.razor.cs │ │ ├── InputFileEditAddress.razor │ │ ├── InputFileEditAddress.razor.cs │ │ ├── InputFileSidebar.razor │ │ ├── InputFileSidebar.razor.cs │ │ ├── InputFileTopNavBar.razor │ │ └── InputFileTopNavBar.razor.cs ├── Notification │ ├── NotificationHistoryDisplay.razor │ └── NotificationHistoryDisplay.razor.cs ├── NuGet │ ├── NuGetPackageManager.razor │ ├── NuGetPackageManager.razor.cs │ ├── NugetPackageDisplay.razor │ └── NugetPackageDisplay.razor.cs ├── Pages │ ├── Authentication.razor │ ├── EditorPage.razor │ ├── EditorPage.razor.cs │ └── Index.razor ├── Panel │ ├── PanelDisplay.razor │ ├── PanelDisplay.razor.cs │ ├── PanelTabDisplay.razor │ └── PanelTabDisplay.razor.cs ├── ServiceCollectionExtensions.cs ├── Settings │ ├── SettingsDialogEntryPoint.razor │ ├── SettingsDialogEntryPoint.razor.cs │ ├── SettingsDisplay.razor │ ├── SettingsDisplay.razor.cs │ └── SettingsDisplay.razor.css ├── Shared │ ├── ActiveContextRecordsDisplay.razor │ ├── ActiveContextRecordsDisplay.razor.cs │ ├── BlazorTextEditorBody.razor │ ├── BlazorTextEditorBody.razor.cs │ ├── BlazorTextEditorExplorers.razor │ ├── BlazorTextEditorExplorers.razor.cs │ ├── BlazorTextEditorFooter.razor │ ├── BlazorTextEditorFooter.razor.cs │ ├── BlazorTextEditorFooterViewTabs.razor │ ├── BlazorTextEditorFooterViewTabs.razor.cs │ ├── BlazorTextEditorHeader.razor │ ├── BlazorTextEditorHeader.razor.cs │ ├── MainLayout.razor │ ├── MainLayout.razor.cs │ ├── ViewTabDisplay.razor │ └── ViewTabDisplay.razor.cs ├── SolutionExplorer │ ├── SolutionExplorerContextMenu.razor │ ├── SolutionExplorerContextMenu.razor.cs │ ├── SolutionExplorerDisplay.razor │ ├── SolutionExplorerDisplay.razor.cs │ ├── SolutionExplorerTreeViewKeymap.cs │ └── SolutionExplorerTreeViewMouseEventHandler.cs ├── StartupControls │ ├── StartupControlsDisplay.razor │ └── StartupControlsDisplay.razor.cs ├── Terminal │ ├── TerminalDisplay.razor │ ├── TerminalDisplay.razor.cs │ ├── TerminalOutputDisplay.razor │ ├── TerminalOutputDisplay.razor.cs │ ├── TerminalWellKnownTab.razor │ └── TerminalWellKnownTab.razor.cs ├── TreeViewImplementations │ ├── TreeViewAbsoluteFilePathDisplay.razor │ ├── TreeViewAbsoluteFilePathDisplay.razor.cs │ ├── TreeViewCSharpProjectDependenciesDisplay.razor │ ├── TreeViewCSharpProjectDependenciesDisplay.razor.cs │ ├── TreeViewCSharpProjectNugetPackageReferencesDisplay.razor │ ├── TreeViewCSharpProjectNugetPackageReferencesDisplay.razor.cs │ ├── TreeViewCSharpProjectToProjectReferenceDisplay.razor │ ├── TreeViewCSharpProjectToProjectReferenceDisplay.razor.cs │ ├── TreeViewCSharpProjectToProjectReferencesDisplay.razor │ ├── TreeViewCSharpProjectToProjectReferencesDisplay.razor.cs │ ├── TreeViewExceptionDisplay.razor │ ├── TreeViewExceptionDisplay.razor.cs │ ├── TreeViewGitFileDisplay.razor │ ├── TreeViewGitFileDisplay.razor.cs │ ├── TreeViewLightWeightNugetPackageRecordDisplay.razor │ ├── TreeViewLightWeightNugetPackageRecordDisplay.razor.cs │ ├── TreeViewNamespacePathDisplay.razor │ ├── TreeViewNamespacePathDisplay.razor.cs │ ├── TreeViewSolutionFolderDisplay.razor │ └── TreeViewSolutionFolderDisplay.razor.cs ├── _Imports.razor └── wwwroot │ ├── Themes │ └── blazorStudioLightTheme.css │ ├── background.png │ ├── blazorStudio.css │ ├── blazorStudio.js │ ├── blazorStudioColors.css │ └── blazorStudioSizes.css ├── BlazorStudio.Tests ├── Basics │ ├── DotNet │ │ ├── CSharpProjectParserTests.cs │ │ └── DotNetSolutionParserTests.cs │ ├── FileSystem │ │ ├── BlazorStudioFileSystemTestingBase.cs │ │ ├── DoNothingJsRuntime.cs │ │ └── FileSystemEffectTests.cs │ ├── SemanticParsing │ │ └── C │ │ │ ├── EvaluatorTests.cs │ │ │ ├── LexerTests.cs │ │ │ └── ParserTests.cs │ └── Terminal │ │ └── DotNetSolutionParserTests.cs ├── BlazorStudio.Tests.csproj ├── UserStories │ └── SemanticParsing │ │ └── C │ │ └── USER_STORY_HELLO_WORLD.cs └── Usings.cs ├── BlazorStudio.sln ├── CHANGELOG.md ├── FEATURES.md ├── Images ├── RootREADME │ ├── blazorTextEditorAnalysisNeedsRef.gif │ ├── cloneBlazorStudio.gif │ ├── cloneBlazorTextEditor.gif │ ├── cloneBlazorTextEditorAnalysis.gif │ ├── cloneGif.gif │ ├── cloneGifIntro.gif │ ├── cloneGifUsage.gif │ └── vscodeWebtools.gif ├── clipart3420085.png ├── contextMenuComponent.gif ├── solutionExplorer.gif ├── startupProject.gif ├── textEditor.gif ├── themes.gif └── windowComponent.gif ├── LICENSE ├── Photino.Blazor ├── LICENSE ├── Photino.Blazor.sln ├── Photino.Blazor │ ├── Photino - Backup.Blazor.csproj │ ├── Photino.Blazor.csproj │ ├── Photino.Blazor.nuspec │ ├── PhotinoBlazorApp.cs │ ├── PhotinoBlazorAppBuilder.cs │ ├── PhotinoBlazorAppConfiguration.cs │ ├── PhotinoDispatcher.cs │ ├── PhotinoHttpHandler.cs │ ├── PhotinoSyncrhronizationContext.cs │ ├── PhotinoWebViewManager.cs │ ├── PhotinoWindowRootComponents.cs │ ├── ServiceCollectionExtensions.cs │ └── Utils │ │ └── SynchronousTaskScheduler.cs ├── README.md ├── azure-pipelines-photino.blazor-dev.yml ├── azure-pipelines-photino.blazor-prod.yml ├── favicon.ico └── photino.png ├── README.md ├── ROADMAP.md └── global.json /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | // Use IntelliSense to find out which attributes exist for C# debugging 6 | // Use hover for the description of the existing attributes 7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/BlazorStudio.Console/bin/Debug/net6.0/BlazorStudio.Console.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}/BlazorStudio.Console", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/BlazorStudio.Console/BlazorStudio.Console.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/BlazorStudio.Console/BlazorStudio.Console.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "--project", 36 | "${workspaceFolder}/BlazorStudio.Console/BlazorStudio.Console.csproj" 37 | ], 38 | "problemMatcher": "$msCompile" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Clipboard/ClipboardPhrase.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Clipboard; 2 | 3 | public class ClipboardPhrase 4 | { 5 | public ClipboardPhrase( 6 | string command, 7 | string dataType, 8 | string value) 9 | { 10 | Command = command; 11 | DataType = dataType; 12 | Value = value; 13 | } 14 | 15 | public string Command { get; set; } 16 | public string DataType { get; set; } 17 | public string Value { get; set; } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/BoundBinaryOperatorNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 3 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | using System.Collections.Immutable; 5 | 6 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes; 7 | 8 | public class BoundBinaryOperatorNode : ISyntaxNode 9 | { 10 | public BoundBinaryOperatorNode( 11 | Type leftOperandType, 12 | ISyntaxToken operatorToken, 13 | Type rightOperandType, 14 | Type resultType) 15 | { 16 | LeftOperandType = leftOperandType; 17 | OperatorToken = operatorToken; 18 | RightOperandType = rightOperandType; 19 | ResultType = resultType; 20 | 21 | Children = new ISyntax[] 22 | { 23 | OperatorToken 24 | } 25 | .ToImmutableArray(); 26 | } 27 | 28 | public Type LeftOperandType { get; } 29 | public ISyntaxToken OperatorToken { get; } 30 | public Type RightOperandType { get; } 31 | public Type ResultType { get; } 32 | 33 | public ImmutableArray Children { get; } 34 | public bool IsFabricated { get; init; } 35 | public SyntaxKind SyntaxKind => SyntaxKind.BoundBinaryOperatorNode; 36 | } 37 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/BoundTypeNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 3 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | using System.Collections.Immutable; 5 | 6 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes; 7 | 8 | public class BoundTypeNode : ISyntaxNode 9 | { 10 | public BoundTypeNode( 11 | Type type, 12 | ISyntaxToken token) 13 | { 14 | Type = type; 15 | Token = token; 16 | 17 | Children = new ISyntax[] 18 | { 19 | token 20 | }.ToImmutableArray(); 21 | } 22 | 23 | public Type Type { get; } 24 | public ISyntaxToken Token { get; } 25 | 26 | public ImmutableArray Children { get; } 27 | public bool IsFabricated { get; init; } 28 | public SyntaxKind SyntaxKind => SyntaxKind.BoundTypeNode; 29 | } 30 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/Expression/BoundBinaryExpressionNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Expression; 5 | 6 | public class BoundBinaryExpressionNode : IBoundExpressionNode 7 | { 8 | public BoundBinaryExpressionNode( 9 | IBoundExpressionNode leftBoundExpressionNode, 10 | BoundBinaryOperatorNode boundBinaryOperatorNode, 11 | IBoundExpressionNode rightBoundExpressionNode) 12 | { 13 | LeftBoundExpressionNode = leftBoundExpressionNode; 14 | BoundBinaryOperatorNode = boundBinaryOperatorNode; 15 | RightBoundExpressionNode = rightBoundExpressionNode; 16 | 17 | Children = new ISyntax[] 18 | { 19 | LeftBoundExpressionNode, 20 | BoundBinaryOperatorNode, 21 | RightBoundExpressionNode 22 | }.ToImmutableArray(); 23 | } 24 | 25 | public IBoundExpressionNode LeftBoundExpressionNode { get; } 26 | public BoundBinaryOperatorNode BoundBinaryOperatorNode { get; } 27 | public IBoundExpressionNode RightBoundExpressionNode { get; } 28 | public Type ResultType => BoundBinaryOperatorNode.ResultType; 29 | 30 | public ImmutableArray Children { get; } 31 | public bool IsFabricated { get; init; } 32 | public SyntaxKind SyntaxKind => SyntaxKind.BoundBinaryExpressionNode; 33 | } 34 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/Expression/BoundLiteralExpressionNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 3 | using System.Collections.Immutable; 4 | 5 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Expression; 6 | 7 | public class BoundLiteralExpressionNode : IBoundExpressionNode 8 | { 9 | public BoundLiteralExpressionNode( 10 | ISyntaxToken literalSyntaxToken, 11 | Type resultType) 12 | { 13 | LiteralSyntaxToken = literalSyntaxToken; 14 | ResultType = resultType; 15 | 16 | Children = new ISyntax[] 17 | { 18 | literalSyntaxToken 19 | }.ToImmutableArray(); 20 | } 21 | 22 | public ISyntaxToken LiteralSyntaxToken { get; } 23 | public Type ResultType { get; } 24 | 25 | public ImmutableArray Children { get; } 26 | public bool IsFabricated { get; init; } 27 | public SyntaxKind SyntaxKind => SyntaxKind.BoundLiteralExpressionNode; 28 | } 29 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/Expression/IBoundExpressionNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes.Expression; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Expression; 4 | 5 | public interface IBoundExpressionNode : IExpressionNode 6 | { 7 | public Type ResultType { get; } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/Statements/BoundFunctionInvocationNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 3 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | using System.Collections.Immutable; 5 | 6 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Statements; 7 | 8 | public class BoundFunctionInvocationNode : ISyntaxNode 9 | { 10 | public BoundFunctionInvocationNode( 11 | ISyntaxToken identifierToken) 12 | { 13 | IdentifierToken = identifierToken; 14 | 15 | Children = new ISyntax[] 16 | { 17 | IdentifierToken 18 | }.ToImmutableArray(); 19 | } 20 | 21 | public ISyntaxToken IdentifierToken { get; } 22 | 23 | public ImmutableArray Children { get; } 24 | public bool IsFabricated { get; init; } 25 | public SyntaxKind SyntaxKind => SyntaxKind.BoundFunctionInvocationNode; 26 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/Statements/BoundReturnStatementNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Expression; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 3 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 4 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 5 | using System.Collections.Immutable; 6 | 7 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Statements; 8 | 9 | public class BoundReturnStatementNode : ISyntaxNode 10 | { 11 | public BoundReturnStatementNode( 12 | KeywordToken keywordToken, 13 | IBoundExpressionNode boundExpressionNode) 14 | { 15 | KeywordToken = keywordToken; 16 | BoundExpressionNode = boundExpressionNode; 17 | 18 | Children = new ISyntax[] 19 | { 20 | KeywordToken, 21 | BoundExpressionNode 22 | }.ToImmutableArray(); 23 | } 24 | 25 | public KeywordToken KeywordToken { get; } 26 | public IBoundExpressionNode BoundExpressionNode { get; } 27 | 28 | public ImmutableArray Children { get; } 29 | public bool IsFabricated { get; init; } 30 | public SyntaxKind SyntaxKind => SyntaxKind.BoundReturnStatementNode; 31 | } 32 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundNodes/Statements/BoundVariableAssignmentStatementNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Expression; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 3 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 4 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 5 | using System.Collections.Immutable; 6 | 7 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Statements; 8 | 9 | public class BoundVariableAssignmentStatementNode : ISyntaxNode 10 | { 11 | public BoundVariableAssignmentStatementNode( 12 | ISyntaxToken identifierToken, 13 | IBoundExpressionNode boundExpressionNode) 14 | { 15 | IdentifierToken = identifierToken; 16 | BoundExpressionNode = boundExpressionNode; 17 | 18 | Children = new ISyntax[] 19 | { 20 | IdentifierToken, 21 | BoundExpressionNode 22 | }.ToImmutableArray(); 23 | } 24 | 25 | public ISyntaxToken IdentifierToken { get; } 26 | public IBoundExpressionNode BoundExpressionNode { get; } 27 | 28 | public ImmutableArray Children { get; } 29 | public bool IsFabricated { get; init; } 30 | public SyntaxKind SyntaxKind => SyntaxKind.BoundVariableAssignmentStatementNode; 31 | } 32 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/BinderCase/BoundScope.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase.BoundNodes.Statements; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase; 4 | 5 | public class BoundScope 6 | { 7 | public BoundScope( 8 | BoundScope? parent, 9 | Type? scopeReturnType, 10 | int startingIndexInclusive, 11 | int? endingIndexExclusive, 12 | Dictionary typeMap, 13 | Dictionary functionDeclarationMap, 14 | Dictionary variableDeclarationMap) 15 | { 16 | Parent = parent; 17 | ScopeReturnType = scopeReturnType; 18 | StartingIndexInclusive = startingIndexInclusive; 19 | EndingIndexExclusive = endingIndexExclusive; 20 | TypeMap = typeMap; 21 | FunctionDeclarationMap = functionDeclarationMap; 22 | VariableDeclarationMap = variableDeclarationMap; 23 | } 24 | 25 | public BoundScope? Parent { get; } 26 | /// A with the value of "null" means refer to the bound scope's 27 | public Type? ScopeReturnType { get; } 28 | public int StartingIndexInclusive { get; } 29 | // TODO: Remove the "internal set" hack and make a new immutable instance instead. 30 | public int? EndingIndexExclusive { get; internal set; } 31 | public Dictionary TypeMap { get; } 32 | public Dictionary FunctionDeclarationMap { get; } 33 | public Dictionary VariableDeclarationMap { get; } 34 | } 35 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/EvaluatorCase/EvaluatorResult.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.EvaluatorCase; 2 | 3 | public class EvaluatorResult 4 | { 5 | public EvaluatorResult( 6 | Type type, 7 | object result) 8 | { 9 | Type = type; 10 | Result = result; 11 | } 12 | 13 | public Type Type { get; } 14 | public object Result { get; } 15 | } 16 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Facts/CLanguageFacts.Main.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Parsing.C.Facts; 2 | 3 | public partial class CLanguageFacts 4 | { 5 | public const char STRING_LITERAL_START = '"'; 6 | public const char STRING_LITERAL_END = '"'; 7 | 8 | public const char COMMENT_SINGLE_LINE_STARTING_CHAR = '/'; 9 | public const string COMMENT_SINGLE_LINE_STARTING_SUBSTRING = "//"; 10 | 11 | public const string COMMENT_MULTI_LINE_STARTING_SUBSTRING = "/*"; 12 | public const char COMMENT_MULTI_LINE_ENDING_IDENTIFYING_CHAR = '*'; 13 | public const string COMMENT_MULTI_LINE_ENDING_SUBSTRING = "*/"; 14 | 15 | public const char PREPROCESSOR_DIRECTIVE_TRANSITION_CHAR = '#'; 16 | 17 | public const char LIBRARY_REFERENCE_ABSOLUTE_PATH_STARTING_CHAR = '<'; 18 | public const char LIBRARY_REFERENCE_ABSOLUTE_PATH_ENDING_CHAR = '>'; 19 | 20 | public const char LIBRARY_REFERENCE_RELATIVE_PATH_STARTING_CHAR = '"'; 21 | public const char LIBRARY_REFERENCE_RELATIVE_PATH_ENDING_CHAR = '"'; 22 | 23 | public const char STATEMENT_DELIMITER_CHAR = ';'; 24 | } 25 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Facts/CLanguageFacts.Punctuation.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Parsing.C.Facts; 2 | 3 | public partial class CLanguageFacts 4 | { 5 | public class Punctuation 6 | { 7 | public const char UNDERSCORE_SPECIAL_CASE = '_'; 8 | } 9 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Facts/CLanguageFacts.Scope.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.BinderCase; 2 | 3 | namespace BlazorStudio.ClassLib.Parsing.C.Facts; 4 | 5 | public partial class CLanguageFacts 6 | { 7 | public class Scope 8 | { 9 | public static BoundScope GetInitialGlobalScope() 10 | { 11 | var typeMap = new Dictionary 12 | { 13 | { 14 | Types.Int.name, 15 | Types.Int.type 16 | }, 17 | { 18 | Types.String.name, 19 | Types.String.type 20 | }, 21 | { 22 | Types.Void.name, 23 | Types.Void.type 24 | } 25 | }; 26 | 27 | return new BoundScope( 28 | null, 29 | typeof(void), 30 | 0, 31 | null, 32 | typeMap, 33 | new(), 34 | new()); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Facts/CLanguageFacts.Types.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Parsing.C.Facts; 2 | 3 | public partial class CLanguageFacts 4 | { 5 | public class Types 6 | { 7 | public static readonly (string name, Type type) Int = ("int", typeof(int)); 8 | public static readonly (string name, Type type) String = ("string", typeof(string)); 9 | public static readonly (string name, Type type) Void = ("void", typeof(void)); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Facts/CLanguageFacts.Whitespace.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Parsing.C.Facts; 2 | 3 | public partial class CLanguageFacts 4 | { 5 | public class Whitespace 6 | { 7 | public const char CARRIAGE_RETURN_CHAR = '\r'; 8 | public const char LINE_FEED_CHAR = '\n'; 9 | 10 | public string CARRIAGE_RETURN_LINE_FEED_SUBSTRING => 11 | $"{CARRIAGE_RETURN_CHAR}{LINE_FEED_CHAR}"; 12 | } 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/SemanticModelResult.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C; 5 | 6 | public class SemanticModelResult 7 | { 8 | public SemanticModelResult( 9 | string text, 10 | ParserSession parserSession, 11 | CompilationUnit compilationUnit) 12 | { 13 | Text = text; 14 | ParserSession = parserSession; 15 | CompilationUnit = compilationUnit; 16 | } 17 | 18 | public string Text { get; } 19 | public ParserSession ParserSession { get; } 20 | public CompilationUnit CompilationUnit { get; } 21 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Symbols/FunctionSymbol.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorTextEditor.RazorLib.Lexing; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Symbols; 5 | 6 | public class FunctionSymbol : ISymbol 7 | { 8 | public FunctionSymbol( 9 | TextEditorTextSpan textSpan) 10 | { 11 | TextSpan = textSpan; 12 | } 13 | 14 | public TextEditorTextSpan TextSpan { get; } 15 | public SyntaxKind SyntaxKind => SyntaxKind.FunctionSymbol; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Symbols/Symbol.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorTextEditor.RazorLib.Lexing; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Symbols; 5 | 6 | public interface ISymbol 7 | { 8 | public TextEditorTextSpan TextSpan { get; } 9 | public SyntaxKind SyntaxKind { get; } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Symbols/TypeSymbol.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorTextEditor.RazorLib.Lexing; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Symbols; 5 | 6 | public class TypeSymbol : ISymbol 7 | { 8 | public TypeSymbol( 9 | TextEditorTextSpan textSpan) 10 | { 11 | TextSpan = textSpan; 12 | } 13 | 14 | public TextEditorTextSpan TextSpan { get; } 15 | public SyntaxKind SyntaxKind => SyntaxKind.TypeSymbol; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Symbols/VariableSymbol.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorTextEditor.RazorLib.Lexing; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Symbols; 5 | 6 | public class VariableSymbol : ISymbol 7 | { 8 | public VariableSymbol( 9 | TextEditorTextSpan textSpan) 10 | { 11 | TextSpan = textSpan; 12 | } 13 | 14 | public TextEditorTextSpan TextSpan { get; } 15 | public SyntaxKind SyntaxKind => SyntaxKind.VariableSymbol; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/ISyntax.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | 3 | public interface ISyntax 4 | { 5 | public SyntaxKind SyntaxKind { get; } 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxKind.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | 3 | public enum SyntaxKind 4 | { 5 | // Tokens 6 | CommentMultiLineToken, 7 | CommentSingleLineToken, 8 | IdentifierToken, 9 | KeywordToken, 10 | NumericLiteralToken, 11 | StringLiteralToken, 12 | TriviaToken, 13 | PreprocessorDirectiveToken, 14 | LibraryReferenceToken, 15 | PlusToken, 16 | EqualsToken, 17 | StatementDelimiterToken, 18 | OpenParenthesisToken, 19 | CloseParenthesisToken, 20 | OpenBraceToken, 21 | CloseBraceToken, 22 | EndOfFileToken, 23 | 24 | // Nodes 25 | CompilationUnit, 26 | LiteralExpressionNode, 27 | BoundLiteralExpressionNode, 28 | BoundBinaryOperatorNode, 29 | BoundBinaryExpressionNode, 30 | PreprocessorLibraryReferenceStatement, 31 | BoundTypeNode, 32 | BoundFunctionDeclarationNode, 33 | BoundVariableDeclarationStatementNode, 34 | BoundVariableAssignmentStatementNode, 35 | BoundFunctionInvocationNode, 36 | BoundReturnStatementNode, 37 | 38 | // Symbols 39 | TypeSymbol, 40 | FunctionSymbol, 41 | VariableSymbol, 42 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/CompilationUnit.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Analysis; 2 | using System.Collections.Immutable; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 5 | 6 | public class CompilationUnit : ISyntaxNode 7 | { 8 | public CompilationUnit( 9 | bool isExpression, 10 | ImmutableArray children) 11 | { 12 | IsExpression = isExpression; 13 | Children = children; 14 | Diagnostics = ImmutableArray.Empty; 15 | } 16 | 17 | public CompilationUnit( 18 | bool isExpression, 19 | ImmutableArray children, 20 | ImmutableArray diagnostics) 21 | { 22 | IsExpression = isExpression; 23 | Children = children; 24 | Diagnostics = diagnostics; 25 | } 26 | 27 | public bool IsExpression { get; } 28 | public ImmutableArray Diagnostics { get; } 29 | 30 | public ImmutableArray Children { get; } 31 | public bool IsFabricated { get; init; } 32 | public SyntaxKind SyntaxKind => SyntaxKind.CompilationUnit; 33 | } 34 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/CompilationUnitBuilder.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Analysis; 2 | using System.Collections.Immutable; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 5 | 6 | public class CompilationUnitBuilder 7 | { 8 | public CompilationUnitBuilder(CompilationUnitBuilder? parent) 9 | { 10 | Parent = parent; 11 | } 12 | 13 | public bool IsExpression { get; set; } 14 | public List Children { get; set; } = new(); 15 | public CompilationUnitBuilder? Parent { get; } 16 | 17 | public CompilationUnit Build() 18 | { 19 | return new CompilationUnit( 20 | IsExpression, 21 | Children.ToImmutableArray()); 22 | } 23 | 24 | public CompilationUnit Build( 25 | ImmutableArray diagnostics) 26 | { 27 | return new CompilationUnit( 28 | IsExpression, 29 | Children.ToImmutableArray(), 30 | diagnostics); 31 | } 32 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/Expression/IExpressionNode.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes.Expression; 2 | 3 | public interface IExpressionNode : ISyntaxNode 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/Expression/LiteralExpressionNode.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 2 | using System.Collections.Immutable; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes.Expression; 5 | 6 | public class LiteralExpressionNode : IExpressionNode 7 | { 8 | public LiteralExpressionNode(ISyntaxToken literalSyntaxToken) 9 | { 10 | LiteralSyntaxToken = literalSyntaxToken; 11 | 12 | Children = new ISyntax[] 13 | { 14 | LiteralSyntaxToken 15 | }.ToImmutableArray(); 16 | } 17 | 18 | public ISyntaxToken LiteralSyntaxToken { get; } 19 | 20 | public ImmutableArray Children { get; } 21 | public bool IsFabricated { get; init; } 22 | public SyntaxKind SyntaxKind => SyntaxKind.LiteralExpressionNode; 23 | } 24 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/ISyntaxNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes; 4 | 5 | public interface ISyntaxNode : ISyntax 6 | { 7 | public ImmutableArray Children { get; } 8 | /// refers to when the expected a node to be valid, but it wasn't.

For example, a function invocation on an undefined function will construct a with set to true.
9 | public bool IsFabricated { get; init; } 10 | } 11 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/Statement/IStatementNode.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes.Statement; 2 | 3 | public interface IStatementNode : ISyntaxNode 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxNodes/Statement/PreprocessorDirectiveStatement.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 2 | using System.Collections.Immutable; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxNodes.Statement; 5 | 6 | public class PreprocessorLibraryReferenceStatement : IStatementNode 7 | { 8 | public PreprocessorLibraryReferenceStatement( 9 | ISyntaxToken includeDirectiveSyntaxToken, 10 | ISyntaxToken libraryReferenceSyntaxToken) 11 | { 12 | IncludeDirectiveSyntaxToken = includeDirectiveSyntaxToken; 13 | LibraryReferenceSyntaxToken = libraryReferenceSyntaxToken; 14 | 15 | Children = new ISyntax[] 16 | { 17 | IncludeDirectiveSyntaxToken, 18 | LibraryReferenceSyntaxToken, 19 | }.ToImmutableArray(); 20 | } 21 | 22 | public ISyntaxToken IncludeDirectiveSyntaxToken { get; } 23 | public ISyntaxToken LibraryReferenceSyntaxToken { get; } 24 | 25 | public ImmutableArray Children { get; } 26 | public bool IsFabricated { get; init; } 27 | public SyntaxKind SyntaxKind => SyntaxKind.PreprocessorLibraryReferenceStatement; 28 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/CloseBraceToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class CloseBraceToken : ISyntaxToken 6 | { 7 | public CloseBraceToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.CloseBraceToken; 15 | } 16 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/CloseParenthesisToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class CloseParenthesisToken : ISyntaxToken 6 | { 7 | public CloseParenthesisToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.CloseParenthesisToken; 15 | } 16 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/CommentMultiLineToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class CommentMultiLineToken : ISyntaxToken 6 | { 7 | public CommentMultiLineToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.CommentMultiLineToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/CommentSingleLineToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class CommentSingleLineToken : ISyntaxToken 6 | { 7 | public CommentSingleLineToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.CommentSingleLineToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/EndOfFileToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class EndOfFileToken : ISyntaxToken 6 | { 7 | public EndOfFileToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.EndOfFileToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/EqualsToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class EqualsToken : ISyntaxToken 6 | { 7 | public EqualsToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.EqualsToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/ISyntaxToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public interface ISyntaxToken : ISyntax 6 | { 7 | public TextEditorTextSpan TextEditorTextSpan { get; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/IdentifierToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class IdentifierToken : ISyntaxToken 6 | { 7 | public IdentifierToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.IdentifierToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/KeywordToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class KeywordToken : ISyntaxToken 6 | { 7 | public KeywordToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.KeywordToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/LibraryReferenceToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class LibraryReferenceToken : ISyntaxToken 6 | { 7 | public LibraryReferenceToken( 8 | TextEditorTextSpan textEditorTextSpan, 9 | bool isAbsolutePath) 10 | { 11 | TextEditorTextSpan = textEditorTextSpan; 12 | IsAbsolutePath = isAbsolutePath; 13 | } 14 | 15 | public TextEditorTextSpan TextEditorTextSpan { get; } 16 | public SyntaxKind SyntaxKind => SyntaxKind.LibraryReferenceToken; 17 | public bool IsAbsolutePath { get; } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/NumericLiteralToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class NumericLiteralToken : ISyntaxToken 6 | { 7 | public NumericLiteralToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.NumericLiteralToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/OpenBraceToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class OpenBraceToken : ISyntaxToken 6 | { 7 | public OpenBraceToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.OpenBraceToken; 15 | } 16 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/OpenParenthesisToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class OpenParenthesisToken : ISyntaxToken 6 | { 7 | public OpenParenthesisToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.OpenParenthesisToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/PlusToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class PlusToken : ISyntaxToken 6 | { 7 | public PlusToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.PlusToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/PreprocessorDirectiveToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class PreprocessorDirectiveToken : ISyntaxToken 6 | { 7 | public PreprocessorDirectiveToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.PreprocessorDirectiveToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/StatementDelimiterToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class StatementDelimiterToken : ISyntaxToken 6 | { 7 | public StatementDelimiterToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.StatementDelimiterToken; 15 | } 16 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/StringLiteralToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class StringLiteralToken : ISyntaxToken 6 | { 7 | public StringLiteralToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.StringLiteralToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/SyntaxTokenHelper.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 2 | 3 | public class SyntaxTokenHelper 4 | { 5 | public static (ISyntaxToken syntaxToken, string text)[] GetTokenTextTuples( 6 | IEnumerable syntaxTokens, 7 | string sourceText) 8 | { 9 | return syntaxTokens 10 | .Select(x => 11 | GetTokenTextTuple(x, sourceText)) 12 | .ToArray(); 13 | } 14 | 15 | public static (ISyntaxToken syntaxToken, string text) GetTokenTextTuple( 16 | ISyntaxToken syntaxToken, 17 | string sourceText) 18 | { 19 | return (syntaxToken, 20 | syntaxToken.TextEditorTextSpan.GetText(sourceText)); 21 | } 22 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/SyntaxTokens/TriviaToken.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Lexing; 2 | 3 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 4 | 5 | public class TriviaToken : ISyntaxToken 6 | { 7 | public TriviaToken( 8 | TextEditorTextSpan textEditorTextSpan) 9 | { 10 | TextEditorTextSpan = textEditorTextSpan; 11 | } 12 | 13 | public TextEditorTextSpan TextEditorTextSpan { get; } 14 | public SyntaxKind SyntaxKind => SyntaxKind.TriviaToken; 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/Syntax/TokenWalker.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax.SyntaxTokens; 3 | 4 | namespace BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 5 | 6 | public class TokenWalker 7 | { 8 | private readonly ImmutableArray _tokens; 9 | 10 | public TokenWalker(ImmutableArray tokens) 11 | { 12 | _tokens = tokens; 13 | } 14 | 15 | public ImmutableArray Tokens => _tokens; 16 | public ISyntaxToken Current => Peek(0); 17 | public ISyntaxToken Next => Peek(1); 18 | public bool IsEof => Current.SyntaxKind == SyntaxKind.EndOfFileToken; 19 | 20 | private int _index; 21 | 22 | public ISyntaxToken Peek(int offset) 23 | { 24 | var index = _index + offset; 25 | 26 | if (index >= _tokens.Length) 27 | { 28 | // Return the end of file token (the last token) 29 | return _tokens[_tokens.Length - 1]; 30 | } 31 | 32 | return _tokens[index]; 33 | } 34 | 35 | public ISyntaxToken Consume() 36 | { 37 | if (_index >= _tokens.Length) 38 | { 39 | // Return the end of file token (the last token) 40 | return _tokens[_tokens.Length - 1]; 41 | } 42 | 43 | return _tokens[_index++]; 44 | } 45 | 46 | public ISyntaxToken Backtrack() 47 | { 48 | if (_index > 0) 49 | _index--; 50 | 51 | return Peek(_index); 52 | } 53 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CodeAnalysis/C/TextEditorLexerC.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorCommon.RazorLib.Misc; 3 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 4 | using BlazorTextEditor.RazorLib.Lexing; 5 | using BlazorTextEditor.RazorLib.Model; 6 | 7 | namespace BlazorStudio.ClassLib.CodeAnalysis.C; 8 | 9 | public class TextEditorLexerC : ITextEditorLexer 10 | { 11 | private readonly object _lexerLock = new object(); 12 | 13 | public RenderStateKey ModelRenderStateKey { get; private set; } = RenderStateKey.Empty; 14 | public LexSession? RecentLexSession { get; private set; } 15 | 16 | public Task> Lex( 17 | string text, 18 | RenderStateKey modelRenderStateKey) 19 | { 20 | LexSession? lexSession; 21 | 22 | lock (_lexerLock) 23 | { 24 | lexSession = RecentLexSession; 25 | 26 | if (ModelRenderStateKey == modelRenderStateKey && 27 | lexSession is not null) 28 | { 29 | return Task.FromResult( 30 | lexSession.SyntaxTokens.Select(x => x.TextEditorTextSpan) 31 | .ToImmutableArray()); 32 | } 33 | 34 | ModelRenderStateKey = modelRenderStateKey; 35 | } 36 | 37 | lexSession = new LexSession(text); 38 | 39 | lexSession.Lex(); 40 | 41 | RecentLexSession = lexSession; 42 | 43 | return Task.FromResult( 44 | lexSession.SyntaxTokens.Select(x => x.TextEditorTextSpan) 45 | .ToImmutableArray()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/CommandLine/GitCliFacts.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.CommandLine; 2 | 3 | public static class GitCliFacts 4 | { 5 | public const string TARGET_FILE_NAME = "git"; 6 | 7 | public const string INIT_COMMAND = "init"; 8 | public const string STATUS_COMMAND = "status"; 9 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/IBlazorStudioComponentRenderers.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.ComponentRenderers; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers; 4 | 5 | public interface IBlazorStudioComponentRenderers 6 | { 7 | public IBlazorCommonComponentRenderers? BlazorCommonComponentRenderers { get; } 8 | public Type? BooleanPromptOrCancelRendererType { get; } 9 | public Type? FileFormRendererType { get; } 10 | public Type? DeleteFileFormRendererType { get; } 11 | public Type? TreeViewNamespacePathRendererType { get; } 12 | public Type? TreeViewSolutionFolderRendererType { get; } 13 | public Type? TreeViewCSharpProjectDependenciesRendererType { get; } 14 | public Type? TreeViewCSharpProjectNugetPackageReferencesRendererType { get; } 15 | public Type? TreeViewCSharpProjectToProjectReferencesRendererType { get; } 16 | public Type? TreeViewLightWeightNugetPackageRecordRendererType { get; } 17 | public Type? TreeViewCSharpProjectToProjectReferenceRendererType { get; } 18 | public Type? TreeViewAbsoluteFilePathRendererType { get; } 19 | public Type? TreeViewGitFileRendererType { get; } 20 | public Type? NuGetPackageManagerRendererType { get; } 21 | public Type? GitDisplayRendererType { get; } 22 | public Type? RemoveCSharpProjectFromSolutionRendererType { get; } 23 | public Type? InputFileRendererType { get; } 24 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/IDeleteFileFormRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface IDeleteFileFormRendererType 6 | { 7 | public IAbsoluteFilePath AbsoluteFilePath { get; set; } 8 | public bool IsDirectory { get; set; } 9 | public Action OnAfterSubmitAction { get; set; } 10 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/IFileFormRendererType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.FileTemplates; 3 | 4 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 5 | 6 | public interface IFileFormRendererType 7 | { 8 | public string FileName { get; set; } 9 | public bool IsDirectory { get; set; } 10 | public bool CheckForTemplates { get; set; } 11 | public Action> OnAfterSubmitAction { get; set; } 12 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/IGitDisplayRendererType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | 3 | public interface IGitDisplayRendererType 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/IInputFileRendererType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | 3 | public interface IInputFileRendererType 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/INuGetPackageManagerRendererType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | 3 | public interface INuGetPackageManagerRendererType 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/IRemoveCSharpProjectFromSolutionRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface IRemoveCSharpProjectFromSolutionRendererType 6 | { 7 | public IAbsoluteFilePath AbsoluteFilePath { get; set; } 8 | public Action OnAfterSubmitAction { get; set; } 9 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/ITreeViewAbsoluteFilePathRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.TreeViewImplementations; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface ITreeViewAbsoluteFilePathRendererType 6 | { 7 | public TreeViewAbsoluteFilePath TreeViewAbsoluteFilePath { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/ITreeViewCSharpProjectToProjectReferenceRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.DotNet.CSharp; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface ITreeViewCSharpProjectToProjectReferenceRendererType 6 | { 7 | public CSharpProjectToProjectReference CSharpProjectToProjectReference { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/ITreeViewGitFileRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.TreeViewImplementations; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface ITreeViewGitFileRendererType 6 | { 7 | public TreeViewGitFile TreeViewGitFile { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/ITreeViewLightWeightNugetPackageRecordRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Nuget; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface ITreeViewLightWeightNugetPackageRecordRendererType 6 | { 7 | public LightWeightNugetPackageRecord LightWeightNugetPackageRecord { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/ITreeViewNamespacePathRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Namespaces; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface ITreeViewNamespacePathRendererType 6 | { 7 | public NamespacePath NamespacePath { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ComponentRenderers/Types/ITreeViewSolutionFolderRendererType.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.DotNet; 2 | 3 | namespace BlazorStudio.ClassLib.ComponentRenderers.Types; 4 | 5 | public interface ITreeViewSolutionFolderRendererType 6 | { 7 | public DotNetSolutionFolder DotNetSolutionFolder { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Context/ContextKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Context; 2 | 3 | public record ContextKey(Guid Guid) 4 | { 5 | public static ContextKey NewContextKey() 6 | { 7 | return new(Guid.NewGuid()); 8 | } 9 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Context/ContextRecord.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Context; 2 | 3 | public record ContextRecord( 4 | ContextKey ContextKey, 5 | string DisplayNameFriendly, 6 | string ContextNameInternal); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Dimensions/SizeFacts.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dimensions; 2 | 3 | namespace BlazorStudio.ClassLib.Dimensions; 4 | 5 | public static class SizeFacts 6 | { 7 | public static class Bstudio 8 | { 9 | public static class Header 10 | { 11 | public static readonly DimensionUnit Height = new() 12 | { 13 | Value = 3, 14 | DimensionUnitKind = DimensionUnitKind.RootCharacterHeight 15 | }; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/CSharp/CSharpProject.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet.CSharp; 4 | 5 | public class CSharpProject : IDotNetProject 6 | { 7 | public CSharpProject( 8 | string displayName, 9 | Guid projectTypeGuid, 10 | string relativePathFromSolutionFileString, 11 | Guid projectIdGuid) 12 | { 13 | DisplayName = displayName; 14 | ProjectTypeGuid = projectTypeGuid; 15 | RelativePathFromSolutionFileString = relativePathFromSolutionFileString; 16 | ProjectIdGuid = projectIdGuid; 17 | } 18 | 19 | public string DisplayName { get; } 20 | public Guid ProjectTypeGuid { get; } 21 | public string RelativePathFromSolutionFileString { get; } 22 | public Guid ProjectIdGuid { get; } 23 | public IAbsoluteFilePath AbsoluteFilePath { get; private set; } 24 | public DotNetProjectKind DotNetProjectKind => DotNetProjectKind.CSharpProject; 25 | 26 | /// 27 | /// TODO: This should just done from within the constructor? That is to say in the constructor for CSharpProjects calculate the absolute path from its relative path from the .sln 28 | /// 29 | public void SetAbsoluteFilePath(IAbsoluteFilePath absoluteFilePath) 30 | { 31 | AbsoluteFilePath = absoluteFilePath; 32 | } 33 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/CSharp/CSharpProjectDependencies.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Namespaces; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet.CSharp; 4 | 5 | public class CSharpProjectDependencies 6 | { 7 | public CSharpProjectDependencies(NamespacePath cSharpProjectNamespacePath) 8 | { 9 | CSharpProjectNamespacePath = cSharpProjectNamespacePath; 10 | } 11 | 12 | public NamespacePath CSharpProjectNamespacePath { get; } 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/CSharp/CSharpProjectNugetPackageReferences.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Namespaces; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet.CSharp; 4 | 5 | public class CSharpProjectNugetPackageReferences 6 | { 7 | public CSharpProjectNugetPackageReferences(NamespacePath cSharpProjectNamespacePath) 8 | { 9 | CSharpProjectNamespacePath = cSharpProjectNamespacePath; 10 | } 11 | 12 | public NamespacePath CSharpProjectNamespacePath { get; } 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/CSharp/CSharpProjectSyntaxWalker.cs: -------------------------------------------------------------------------------- 1 | using BlazorTextEditor.RazorLib.Analysis.Html.SyntaxActors; 2 | using BlazorTextEditor.RazorLib.Analysis.Html.SyntaxObjects; 3 | 4 | namespace BlazorStudio.ClassLib.DotNet.CSharp; 5 | 6 | public class CSharpProjectSyntaxWalker : XmlSyntaxWalker 7 | { 8 | public List TagSyntaxes { get; } = new(); 9 | 10 | public override void VisitTagSyntax(TagSyntax tagSyntax) 11 | { 12 | TagSyntaxes.Add(tagSyntax); 13 | base.VisitTagSyntax(tagSyntax); 14 | } 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/CSharp/CSharpProjectToProjectReference.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | using BlazorStudio.ClassLib.Namespaces; 3 | 4 | namespace BlazorStudio.ClassLib.DotNet.CSharp; 5 | 6 | public class CSharpProjectToProjectReference 7 | { 8 | public CSharpProjectToProjectReference( 9 | NamespacePath modifyProjectNamespacePath, 10 | IAbsoluteFilePath referenceProjectAbsoluteFilePath) 11 | { 12 | ModifyProjectNamespacePath = modifyProjectNamespacePath; 13 | ReferenceProjectAbsoluteFilePath = referenceProjectAbsoluteFilePath; 14 | } 15 | 16 | /// The is the of the Project which will have its XML data modified. 17 | public NamespacePath ModifyProjectNamespacePath { get; } 18 | public IAbsoluteFilePath ReferenceProjectAbsoluteFilePath { get; } 19 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/CSharp/CSharpProjectToProjectReferences.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Namespaces; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet.CSharp; 4 | 5 | public class CSharpProjectToProjectReferences 6 | { 7 | public CSharpProjectToProjectReferences(NamespacePath cSharpProjectNamespacePath) 8 | { 9 | CSharpProjectNamespacePath = cSharpProjectNamespacePath; 10 | } 11 | 12 | public NamespacePath CSharpProjectNamespacePath { get; } 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetProjectKind.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.DotNet; 2 | 3 | /// 4 | /// is not to be confused with 5 | ///

6 | /// is used by the user interface to determine quickly without 7 | /// type inspection how the tree view node should be rendered in the solution explorer. 8 | ///
9 | public enum DotNetProjectKind 10 | { 11 | SolutionFolder, 12 | CSharpProject 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetSolution.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.Namespaces; 3 | 4 | namespace BlazorStudio.ClassLib.DotNet; 5 | 6 | public record DotNetSolution( 7 | NamespacePath NamespacePath, 8 | ImmutableList DotNetProjects, 9 | ImmutableList SolutionFolders, 10 | DotNetSolutionGlobalSection DotNetSolutionGlobalSection) 11 | { 12 | public Guid Id { get; init; } = Guid.NewGuid(); 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetSolutionFacts.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.DotNet; 2 | 3 | public class DotNetSolutionFacts 4 | { 5 | // Example text: Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") 6 | public const string START_OF_PROJECT_DEFINITION = "Project("; 7 | // Example text: Project(...\nEndProject\n 8 | public const string END_OF_PROJECT_DEFINITION = "EndProject"; 9 | 10 | // Example text: Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") 11 | public const string START_OF_PROJECT_DEFINITION_MEMBER = "\""; 12 | // Example text: Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") 13 | public const string END_OF_PROJECT_DEFINITION_MEMBER = "\""; 14 | 15 | // Example text: Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") 16 | public const string START_OF_GUID = "{"; 17 | // Example text: Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") 18 | public const string END_OF_GUID = "}"; 19 | 20 | public const string START_OF_GLOBAL_SECTION = "GlobalSection("; 21 | public const string END_OF_GLOBAL_SECTION = "EndGlobalSection"; 22 | 23 | public const string START_OF_GLOBAL_SECTION_NESTED_PROJECTS = "NestedProjects)"; 24 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetSolutionFolder.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet; 4 | 5 | public class DotNetSolutionFolder : IDotNetProject 6 | { 7 | public static readonly Guid SolutionFolderProjectTypeGuid = Guid.Parse("2150E333-8FDC-42A3-9474-1A3956D46DE8"); 8 | 9 | public DotNetSolutionFolder( 10 | string displayName, 11 | Guid projectTypeGuid, 12 | string relativePathFromSolutionFileString, 13 | Guid projectIdGuid) 14 | { 15 | DisplayName = displayName; 16 | ProjectTypeGuid = projectTypeGuid; 17 | RelativePathFromSolutionFileString = relativePathFromSolutionFileString; 18 | ProjectIdGuid = projectIdGuid; 19 | } 20 | 21 | public string DisplayName { get; } 22 | public Guid ProjectTypeGuid { get; } 23 | public string RelativePathFromSolutionFileString { get; } 24 | public Guid ProjectIdGuid { get; } 25 | public IAbsoluteFilePath AbsoluteFilePath { get; private set; } 26 | public DotNetProjectKind DotNetProjectKind => DotNetProjectKind.SolutionFolder; 27 | 28 | /// 29 | /// TODO: This should just done from within the constructor? That is to say in the constructor for CSharpProjects calculate the absolute path from its relative path from the .sln 30 | /// 31 | public void SetAbsoluteFilePath(IAbsoluteFilePath absoluteFilePath) 32 | { 33 | AbsoluteFilePath = absoluteFilePath; 34 | } 35 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetSolutionGlobalSection.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.DotNet.DotNetSolutionGlobalSectionTypes; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet; 4 | 5 | public record DotNetSolutionGlobalSection( 6 | GlobalSectionNestedProjects GlobalSectionNestedProjects); 7 | 8 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetSolutionGlobalSectionTypes/GlobalSectionNestedProjects.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet.DotNetSolutionGlobalSectionTypes; 4 | 5 | public record GlobalSectionNestedProjects( 6 | ImmutableArray NestedProjectEntries); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/DotNetSolutionGlobalSectionTypes/NestedProjectEntry.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.DotNet.DotNetSolutionGlobalSectionTypes; 2 | 3 | public record NestedProjectEntry( 4 | Guid ChildProjectIdGuid, 5 | Guid SolutionFolderIdGuid); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/DotNet/IDotNetProject.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.DotNet; 4 | 5 | public interface IDotNetProject 6 | { 7 | public string DisplayName { get; } 8 | public Guid ProjectTypeGuid { get; } 9 | public string RelativePathFromSolutionFileString { get; } 10 | public Guid ProjectIdGuid { get; } 11 | public IAbsoluteFilePath AbsoluteFilePath { get; } 12 | public DotNetProjectKind DotNetProjectKind { get; } 13 | 14 | public void SetAbsoluteFilePath(IAbsoluteFilePath absoluteFilePath); 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Dto/InternalResponse.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Dto; 2 | 3 | public class InternalResponse : InternalResponseVoid 4 | { 5 | public InternalResponse( 6 | string itemJson, 7 | string message) 8 | : base(message) 9 | { 10 | ItemJson = itemJson; 11 | Message = message; 12 | } 13 | 14 | public string ItemJson { get; } 15 | public string Message { get; } 16 | 17 | public Type ItemType => typeof(T); 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Dto/InternalResponseVoid.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Dto; 2 | 3 | public class InternalResponseVoid 4 | { 5 | public InternalResponseVoid( 6 | string message) 7 | { 8 | Message = message; 9 | } 10 | 11 | public string Message { get; } 12 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileConstants/HiddenFileFacts.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.FileConstants; 4 | 5 | public static class HiddenFileFacts 6 | { 7 | public const string BIN = "bin"; 8 | public const string OBJ = "obj"; 9 | 10 | /// 11 | /// If rendering a .csproj file pass in 12 | /// 13 | /// Then perhaps the returning array would contain { "bin", "obj" } as they should be hidden 14 | /// with this context. 15 | /// 16 | /// 17 | public static ImmutableArray GetHiddenFilesByContainerFileExtension(string extensionNoPeriod) 18 | { 19 | return extensionNoPeriod switch 20 | { 21 | ExtensionNoPeriodFacts.C_SHARP_PROJECT => new[] { BIN, OBJ }.ToImmutableArray(), 22 | _ => ImmutableArray.Empty 23 | }; 24 | } 25 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileConstants/UniqueFileFacts.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.FileConstants; 4 | 5 | public static class UniqueFileFacts 6 | { 7 | public const string Properties = "Properties"; 8 | public const string WwwRoot = "wwwroot"; 9 | 10 | /// 11 | /// If rendering a .csproj file pass in 12 | /// 13 | /// Then perhaps the returning array would contain { "Properties", "wwwroot" } as they are unique files 14 | /// with this context. 15 | /// 16 | /// 17 | public static ImmutableArray GetUniqueFilesByContainerFileExtension(string extensionNoPeriod) 18 | { 19 | return extensionNoPeriod switch 20 | { 21 | ExtensionNoPeriodFacts.C_SHARP_PROJECT => new[] { Properties, WwwRoot }.ToImmutableArray(), 22 | _ => ImmutableArray.Empty 23 | }; 24 | } 25 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/FilePath/AbsoluteFilePathStringValue.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 4 | 5 | public record AbsoluteFilePathStringValue(string AbsoluteFilePathString) 6 | { 7 | public AbsoluteFilePathStringValue(IAbsoluteFilePath absoluteFilePath) 8 | : this(absoluteFilePath.GetAbsoluteFilePathString()) 9 | { 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/FilePath/FilePathHelper.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 4 | 5 | public static class FilePathHelper 6 | { 7 | public static string StripEndingDirectorySeparatorIfExists( 8 | string filePath, 9 | IEnvironmentProvider environmentProvider) 10 | { 11 | if (filePath.EndsWith(environmentProvider.DirectorySeparatorChar) || 12 | filePath.EndsWith(environmentProvider.AltDirectorySeparatorChar)) 13 | { 14 | return filePath.Substring( 15 | 0, 16 | filePath.Length - 1); 17 | } 18 | 19 | return filePath; 20 | } 21 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/FilePath/FilePathType.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 2 | 3 | public enum FilePathType 4 | { 5 | AbsoluteFilePath, 6 | RelativeFilePath 7 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/FilePath/FileSystemDrive.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 4 | 5 | public class FileSystemDrive : IFileSystemDrive 6 | { 7 | public FileSystemDrive( 8 | string driveNameAsIdentifier, 9 | IEnvironmentProvider environmentProvider) 10 | { 11 | DriveNameAsIdentifier = driveNameAsIdentifier; 12 | EnvironmentProvider = environmentProvider; 13 | } 14 | 15 | public string DriveNameAsIdentifier { get; } 16 | public IEnvironmentProvider EnvironmentProvider { get; } 17 | public string DriveNameAsPath => $"{DriveNameAsIdentifier}:{EnvironmentProvider.DirectorySeparatorChar}"; 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/FilePath/PathFormatter.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 2 | 3 | public static class PathFormatter 4 | { 5 | public static string FormatAbsoluteFilePathString( 6 | string absoluteFilePathString, 7 | char directorySeparatorChar, 8 | bool isDirectory) 9 | { 10 | if (absoluteFilePathString.StartsWith(directorySeparatorChar)) 11 | { 12 | absoluteFilePathString = new string(absoluteFilePathString 13 | .Skip(1) 14 | .ToArray()); 15 | } 16 | 17 | if (isDirectory) 18 | { 19 | if (!absoluteFilePathString.EndsWith(directorySeparatorChar)) 20 | { 21 | absoluteFilePathString = absoluteFilePathString + 22 | directorySeparatorChar; 23 | } 24 | } 25 | else 26 | { 27 | if (absoluteFilePathString.EndsWith(directorySeparatorChar)) 28 | { 29 | absoluteFilePathString = new string(absoluteFilePathString 30 | .SkipLast(1) 31 | .ToArray()); 32 | } 33 | } 34 | 35 | return absoluteFilePathString; 36 | } 37 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/Local/LocalEnvironmentProvider.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 2 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 3 | 4 | namespace BlazorStudio.ClassLib.FileSystem.Classes.Local; 5 | 6 | public class LocalEnvironmentProvider : IEnvironmentProvider 7 | { 8 | public IAbsoluteFilePath RootDirectoryAbsoluteFilePath => new AbsoluteFilePath( 9 | "/", 10 | true, 11 | this); 12 | 13 | public IAbsoluteFilePath HomeDirectoryAbsoluteFilePath => new AbsoluteFilePath( 14 | Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 15 | true, 16 | this); 17 | 18 | public char DirectorySeparatorChar => Path.DirectorySeparatorChar; 19 | public char AltDirectorySeparatorChar => Path.AltDirectorySeparatorChar; 20 | 21 | public string GetRandomFileName() 22 | { 23 | return Path.GetRandomFileName(); 24 | } 25 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/Local/LocalFileSystemProvider.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.FileSystem.Classes.Local; 4 | 5 | public class LocalFileSystemProvider : IFileSystemProvider 6 | { 7 | public LocalFileSystemProvider() 8 | { 9 | File = new LocalFileHandler(); 10 | Directory = new LocalDirectoryHandler(); 11 | } 12 | 13 | public IFileHandler File { get; } 14 | public IDirectoryHandler Directory { get; } 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/Website/WebsiteEnvironmentProvider.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Store.AccountCase; 2 | using BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 3 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 4 | using Fluxor; 5 | 6 | namespace BlazorStudio.ClassLib.FileSystem.Classes.Website; 7 | 8 | public class WebsiteEnvironmentProvider : IEnvironmentProvider 9 | { 10 | private readonly IState _accountStateWrap; 11 | 12 | public WebsiteEnvironmentProvider( 13 | IState accountStateWrap) 14 | { 15 | _accountStateWrap = accountStateWrap; 16 | } 17 | 18 | public IAbsoluteFilePath RootDirectoryAbsoluteFilePath 19 | { 20 | get 21 | { 22 | var accountState = _accountStateWrap.Value; 23 | 24 | return new AbsoluteFilePath( 25 | string.Empty, 26 | true, 27 | this); 28 | } 29 | } 30 | 31 | public IAbsoluteFilePath HomeDirectoryAbsoluteFilePath 32 | { 33 | get 34 | { 35 | var accountState = _accountStateWrap.Value; 36 | 37 | return new AbsoluteFilePath( 38 | accountState.GroupName + '/', 39 | true, 40 | this); 41 | } 42 | } 43 | 44 | public char DirectorySeparatorChar => '/'; 45 | public char AltDirectorySeparatorChar => '/'; 46 | 47 | public string GetRandomFileName() 48 | { 49 | return Guid.NewGuid().ToString(); 50 | } 51 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Classes/Website/WebsiteFileSystemProvider.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Store.AccountCase; 2 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 3 | using Fluxor; 4 | 5 | namespace BlazorStudio.ClassLib.FileSystem.Classes.Website; 6 | 7 | public class WebsiteFileSystemProvider : IFileSystemProvider 8 | { 9 | private readonly IEnvironmentProvider _environmentProvider; 10 | private readonly IState _accountStateWrap; 11 | private readonly HttpClient _httpClient; 12 | 13 | public WebsiteFileSystemProvider( 14 | IEnvironmentProvider environmentProvider, 15 | IState accountStateWrap, 16 | HttpClient httpClient) 17 | { 18 | _environmentProvider = environmentProvider; 19 | _accountStateWrap = accountStateWrap; 20 | _httpClient = httpClient; 21 | 22 | File = new WebsiteFileHandler( 23 | environmentProvider, 24 | accountStateWrap, 25 | httpClient); 26 | 27 | Directory = new WebsiteDirectoryHandler( 28 | environmentProvider, 29 | accountStateWrap, 30 | httpClient); 31 | } 32 | 33 | public IFileHandler File { get; set; } 34 | public IDirectoryHandler Directory { get; set; } 35 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/AbsoluteFilePathKind.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public enum AbsoluteFilePathKind 4 | { 5 | Default, 6 | DotNet 7 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IAbsoluteFilePath.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | /// 4 | /// TODO: I was not aware of nor when I started this project. I will when I find time remedy this mistake and change over to Microsoft's file system classes. 5 | /// 6 | public interface IAbsoluteFilePath : IFilePath 7 | { 8 | /// 9 | /// Only non null when specifying a drive to mount 10 | /// 11 | /// Example: "C:\\" gets stored as "C" 12 | /// 13 | /// To get the guaranteed non null root directory 14 | /// use GetRootDirectory 15 | /// 16 | public IFileSystemDrive? RootDrive { get; } 17 | /// 18 | /// Returns either System.IO.Path.DirectorySeparatorChar 19 | /// 20 | /// OR 21 | /// 22 | /// Returns $"{RootDrive}:{System.IO.Path.DirectorySeparatorChar}" 23 | /// 24 | public string GetRootDirectory { get; } 25 | public string GetAbsoluteFilePathString(); 26 | public AbsoluteFilePathKind AbsoluteFilePathKind { get; } 27 | public IAbsoluteFilePath? ParentDirectory { get; } 28 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IDirectoryHandler.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public interface IDirectoryHandler 4 | { 5 | public Task CreateDirectoryAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 6 | public Task DeleteAsync(string absoluteFilePathString, bool recursive, CancellationToken cancellationToken = default); 7 | public Task ExistsAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 8 | public Task MoveAsync(string sourceAbsoluteFilePathString, string destinationAbsoluteFilePathString, CancellationToken cancellationToken = default); 9 | public Task GetDirectoriesAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 10 | public Task GetFilesAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 11 | public Task> EnumerateFileSystemEntriesAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 12 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IEnvironmentProvider.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public interface IEnvironmentProvider 4 | { 5 | public IAbsoluteFilePath HomeDirectoryAbsoluteFilePath { get; } 6 | public IAbsoluteFilePath RootDirectoryAbsoluteFilePath { get; } 7 | public char DirectorySeparatorChar { get; } 8 | public char AltDirectorySeparatorChar { get; } 9 | 10 | public string GetRandomFileName(); 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IFileHandler.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public interface IFileHandler 4 | { 5 | public Task ExistsAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 6 | public Task DeleteAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 7 | public Task CopyAsync(string sourceAbsoluteFilePathString, string destinationAbsoluteFilePathString, CancellationToken cancellationToken = default); 8 | public Task MoveAsync(string sourceAbsoluteFilePathString, string destinationAbsoluteFilePathString, CancellationToken cancellationToken = default); 9 | public Task GetLastWriteTimeAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 10 | public Task ReadAllTextAsync(string absoluteFilePathString, CancellationToken cancellationToken = default); 11 | public Task WriteAllTextAsync(string absoluteFilePathString, string contents, CancellationToken cancellationToken = default); 12 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IFilePath.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 2 | 3 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 4 | 5 | /// 6 | /// A side comment: Windows allow both '\\' and '/' as file delimiters. 7 | /// Be sure to check both System.IO.Path.DirectorySeparatorChar and 8 | /// System.IO.Path.AltDirectorySeparatorChar 9 | /// 10 | public interface IFilePath 11 | { 12 | public FilePathType FilePathType { get; } 13 | public bool IsDirectory { get; } 14 | public List Directories { get; } 15 | public string FileNameNoExtension { get; } 16 | public string ExtensionNoPeriod { get; } 17 | public string FilenameWithExtension { get; } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IFileSystemDrive.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public interface IFileSystemDrive 4 | { 5 | public string DriveNameAsIdentifier { get; } 6 | public string DriveNameAsPath { get; } 7 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IFileSystemProvider.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public interface IFileSystemProvider 4 | { 5 | public IFileHandler File { get; } 6 | public IDirectoryHandler Directory { get; } 7 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/IRelativeFilePath.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | public interface IRelativeFilePath : IFilePath 4 | { 5 | public string GetRelativeFilePathString(); 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileSystem/Interfaces/README.md: -------------------------------------------------------------------------------- 1 | # BlazorStudio.ClassLib/FileSystem/Interfaces 2 | This directory contains the Interfaces and Classes for representing the user's file system as C# classes. For example [AbsoluteFilePath.cs](/BlazorStudio.ClassLib/FileSystem/Classes/AbsoluteFilePath.cs) is used for mainly two reasons: 3 | 4 | - A string is ambiguous. Is the string an absolute path or a relative path? AbsoluteFilePath.cs removes this ambiguity. 5 | - Instead of parsing an absolute file path string every time a section of that string is needed (example: a filename) one can parse the string once and maintain all that data on a class. -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/FileTemplate.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.FileTemplates; 4 | 5 | public class FileTemplate : IFileTemplate 6 | { 7 | public FileTemplate( 8 | string displayName, 9 | string codeName, 10 | FileTemplateKind fileTemplateKind, 11 | Func isExactTemplate, 12 | Func> relatedFileTemplatesFunc, 13 | bool initialCheckedStateWhenIsRelatedFile, 14 | Func constructFileContents) 15 | { 16 | DisplayName = displayName; 17 | CodeName = codeName; 18 | FileTemplateKind = fileTemplateKind; 19 | IsExactTemplate = isExactTemplate; 20 | RelatedFileTemplatesFunc = relatedFileTemplatesFunc; 21 | InitialCheckedStateWhenIsRelatedFile = initialCheckedStateWhenIsRelatedFile; 22 | ConstructFileContents = constructFileContents; 23 | } 24 | 25 | public Guid Id { get; } = Guid.NewGuid(); 26 | public string DisplayName { get; } 27 | public string CodeName { get; } 28 | public FileTemplateKind FileTemplateKind { get; } 29 | public Func IsExactTemplate { get; } 30 | public Func> RelatedFileTemplatesFunc { get; } 31 | public bool InitialCheckedStateWhenIsRelatedFile { get; } 32 | public Func ConstructFileContents { get; } 33 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/FileTemplateKind.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.FileTemplates; 2 | 3 | /// 4 | /// Use to search 5 | /// file templates by language. 6 | /// 7 | public enum FileTemplateKind 8 | { 9 | Empty, 10 | CSharp, 11 | JavaScript, 12 | TypeScript, 13 | Razor, 14 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/FileTemplateParameter.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | using BlazorStudio.ClassLib.Namespaces; 3 | 4 | namespace BlazorStudio.ClassLib.FileTemplates; 5 | 6 | public class FileTemplateParameter 7 | { 8 | public FileTemplateParameter( 9 | string filename, 10 | NamespacePath parentDirectory, 11 | IEnvironmentProvider environmentProvider) 12 | { 13 | Filename = filename; 14 | ParentDirectory = parentDirectory; 15 | EnvironmentProvider = environmentProvider; 16 | } 17 | 18 | public string Filename { get; } 19 | public NamespacePath ParentDirectory { get; } 20 | public IEnvironmentProvider EnvironmentProvider { get; } 21 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/FileTemplateProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.FileTemplates; 4 | 5 | public class FileTemplateProvider : IFileTemplateProvider 6 | { 7 | private List _fileTemplates = new(); 8 | 9 | /// 10 | /// The order of the entries in is important 11 | /// as the .FirstOrDefault(x => ...true...) is used. 12 | /// 13 | public FileTemplateProvider() 14 | { 15 | 16 | _fileTemplates.Add(FileTemplateFacts.RazorCodebehind); 17 | _fileTemplates.Add(FileTemplateFacts.RazorMarkup); 18 | _fileTemplates.Add(FileTemplateFacts.CSharpClass); 19 | } 20 | 21 | public ImmutableArray FileTemplates => _fileTemplates 22 | .ToImmutableArray(); 23 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/FileTemplateResult.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Namespaces; 2 | 3 | namespace BlazorStudio.ClassLib.FileTemplates; 4 | 5 | public class FileTemplateResult 6 | { 7 | public FileTemplateResult( 8 | NamespacePath fileNamespacePath, 9 | string contents) 10 | { 11 | FileNamespacePath = fileNamespacePath; 12 | Contents = contents; 13 | } 14 | 15 | public NamespacePath FileNamespacePath { get; } 16 | public string Contents { get; } 17 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/IFileTemplate.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.FileTemplates; 4 | 5 | public interface IFileTemplate 6 | { 7 | public Guid Id { get; } 8 | /// 9 | /// Name displayed to a user 10 | /// 11 | public string DisplayName { get; } 12 | /// 13 | /// Internally used name 14 | /// 15 | public string CodeName { get; } 16 | public FileTemplateKind FileTemplateKind { get; } 17 | /// 18 | /// Func<string filename, bool isApplicable> 19 | ///

20 | /// Take .SingleOrDefault() to find the IsExactTemplate 21 | ///
22 | public Func IsExactTemplate { get; } 23 | /// 24 | /// Func<string filename, bool isApplicable> 25 | ///

26 | /// refers to the user making a 27 | /// '.razor' file and them being then prompted if they want to make 28 | /// a codebehind as well. The codebehind is the related file. 29 | ///
30 | public Func> RelatedFileTemplatesFunc { get; } 31 | /// 32 | /// When the user types ".razor" is the codebehind template input element checked 33 | /// by default? 34 | /// 35 | public bool InitialCheckedStateWhenIsRelatedFile { get; } 36 | /// 37 | /// Func<string filename, NamespacePath parentDirectory, Task writeOutFileTask> 38 | /// 39 | public Func ConstructFileContents { get; } 40 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/FileTemplates/IFileTemplateProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.FileTemplates; 4 | 5 | public interface IFileTemplateProvider 6 | { 7 | public ImmutableArray FileTemplates { get; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Git/GitDirtyReason.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Git; 2 | 3 | public enum GitDirtyReason 4 | { 5 | None, 6 | Untracked, 7 | Added, 8 | Modified, 9 | Deleted, 10 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Git/GitFacts.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Store.TerminalCase; 2 | 3 | namespace BlazorStudio.ClassLib.Git; 4 | 5 | public static class GitFacts 6 | { 7 | public const string GIT_FOLDER_NAME = ".git"; 8 | 9 | public const string UNTRACKED_FILES_TEXT_START = "Untracked files:"; 10 | public const string CHANGES_NOT_STAGED_FOR_COMMIT_TEXT_START = "Changes not staged for commit:"; 11 | 12 | public const string GIT_DIRTY_REASON_MODIFIED = "modified:"; 13 | public const string GIT_DIRTY_REASON_DELETED = "deleted:"; 14 | 15 | public static readonly TerminalCommandKey GitInitTerminalCommandKey = 16 | TerminalCommandKey.NewTerminalCommandKey(); 17 | 18 | public static readonly TerminalCommandKey GitStatusTerminalCommandKey = 19 | TerminalCommandKey.NewTerminalCommandKey(); 20 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Git/GitFile.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.Git; 4 | 5 | public record GitFile( 6 | IAbsoluteFilePath AbsoluteFilePath, 7 | GitDirtyReason GitDirtyReason) 8 | { 9 | public bool IsDirty => GitDirtyReason switch 10 | { 11 | GitDirtyReason.None => false, 12 | GitDirtyReason.Untracked => true, 13 | GitDirtyReason.Added => true, 14 | GitDirtyReason.Modified => true, 15 | GitDirtyReason.Deleted => true, 16 | _ => throw new ApplicationException( 17 | GetUnrecognizedGitDirtyReasonExceptionMessage(GitDirtyReason)) 18 | }; 19 | 20 | private static string GetUnrecognizedGitDirtyReasonExceptionMessage(GitDirtyReason gitDirtyReason) => 21 | $"The {nameof(GitDirtyReason)}: {gitDirtyReason} was unrecognized."; 22 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Html/HtmlFacts.Button.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Html; 2 | 3 | public static partial class HtmlFacts 4 | { 5 | public static class Classes 6 | { 7 | public const string DIALOG_PADDING_0 = "bstudio_dialog-padding-0"; 8 | } 9 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Html/HtmlFacts.Main.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Html; 2 | 3 | public static partial class HtmlFacts 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Html/HtmlHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace BlazorStudio.ClassLib.Html; 4 | 5 | public static class HtmlHelper 6 | { 7 | private static readonly string SpaceString = " "; 8 | private static readonly string TabString = "    "; 9 | private static readonly string NewLineString = "
"; 10 | private static readonly string AmpersandString = "&"; 11 | private static readonly string LeftAngleBracketString = "<"; 12 | private static readonly string RightAngleBracketString = ">"; 13 | private static readonly string DoubleQuoteString = """; 14 | private static readonly string SingleQuoteString = "'"; 15 | 16 | public static string EscapeHtml(this char input) 17 | { 18 | return input.ToString().EscapeHtml(); 19 | } 20 | 21 | public static string EscapeHtml(this StringBuilder input) 22 | { 23 | return input.ToString().EscapeHtml(); 24 | } 25 | 26 | public static string EscapeHtml(this string input) 27 | { 28 | return input 29 | .Replace("&", AmpersandString) 30 | .Replace("<", LeftAngleBracketString) 31 | .Replace(">", RightAngleBracketString) 32 | .Replace("\t", TabString) 33 | .Replace(" ", SpaceString) 34 | .Replace("\r\n", NewLineString) 35 | .Replace("\n", NewLineString) 36 | .Replace("\r", NewLineString) 37 | .Replace("\"", DoubleQuoteString) 38 | .Replace("'", SingleQuoteString); 39 | } 40 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/InputFile/InputFilePattern.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.InputFile; 4 | 5 | public class InputFilePattern 6 | { 7 | public InputFilePattern( 8 | string patternName, 9 | Func matchesPatternFunc) 10 | { 11 | PatternName = patternName; 12 | MatchesPatternFunc = matchesPatternFunc; 13 | } 14 | 15 | public string PatternName { get; } 16 | public Func MatchesPatternFunc { get; } 17 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Namespaces/NamespacePath.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.Namespaces; 4 | 5 | public class NamespacePath 6 | { 7 | public NamespacePath(string namespaceString, IAbsoluteFilePath absoluteFilePath) 8 | { 9 | Namespace = namespaceString; 10 | AbsoluteFilePath = absoluteFilePath; 11 | } 12 | 13 | public string Namespace { get; set; } 14 | public IAbsoluteFilePath AbsoluteFilePath { get; set; } 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Nuget/INugetPackageManagerProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.Nuget; 4 | 5 | public interface INugetPackageManagerProvider 6 | { 7 | public string ProviderWebsiteUrlNoFormatting { get; } 8 | 9 | public Task> QueryForNugetPackagesAsync( 10 | string query, 11 | bool includePrerelease = false, 12 | CancellationToken cancellationToken = default); 13 | 14 | public Task> QueryForNugetPackagesAsync( 15 | INugetPackageManagerQuery nugetPackageManagerQuery, 16 | CancellationToken cancellationToken = default); 17 | 18 | public INugetPackageManagerQuery BuildQuery(string query, bool includePrerelease = false); 19 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Nuget/INugetPackageManagerQuery.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Nuget; 2 | 3 | public interface INugetPackageManagerQuery 4 | { 5 | public string Query { get; } 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Nuget/LightWeightNugetPackageRecord.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Nuget; 2 | 3 | public record LightWeightNugetPackageRecord( 4 | string Id, 5 | string Title, 6 | string Version); 7 | 8 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Nuget/NugetPackageRecord.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace BlazorStudio.ClassLib.Nuget; 5 | 6 | /// 7 | /// When reading response Nuget returns as a member named "@id" 8 | /// 9 | public record NugetPackageRecord( 10 | string Type, 11 | string Registration, 12 | string Id, 13 | string Version, 14 | string Description, 15 | string Summary, 16 | string Title, 17 | string IconUrl, 18 | string LicenseUrl, 19 | string ProjectUrl, 20 | ImmutableArray Tags, 21 | ImmutableArray Authors, 22 | ImmutableArray Owners, 23 | long TotalDownloads, 24 | bool Verified, 25 | ImmutableArray Versions) 26 | { 27 | [JsonPropertyName("@id")] 28 | public string AtId { get; init; } = string.Empty; 29 | 30 | // TODO: Pull this property's data from the JSON but it seems to not be VITAL at this moment. 31 | // public ImmutableArray PackageTypes { get; init; } 32 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Nuget/NugetPackageVersionRecord.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace BlazorStudio.ClassLib.Nuget; 4 | 5 | /// 6 | /// When reading response Nuget returns as a member named "@id" 7 | /// 8 | public record NugetPackageVersionRecord( 9 | string Version, 10 | long Downloads) 11 | { 12 | [JsonPropertyName("@id")] 13 | public string AtId { get; init; } = string.Empty; 14 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Nuget/NugetResponse.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Nuget; 2 | 3 | public record NugetResponse( 4 | int TotalHits, 5 | NugetPackageRecord[] Data); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Panel/PanelFacts.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Store.PanelCase; 2 | 3 | namespace BlazorStudio.ClassLib.Panel; 4 | 5 | public static class PanelFacts 6 | { 7 | public static readonly PanelRecordKey LeftPanelRecordKey = PanelRecordKey.NewPanelRecordKey(); 8 | public static readonly PanelRecordKey RightPanelRecordKey = PanelRecordKey.NewPanelRecordKey(); 9 | public static readonly PanelRecordKey BottomPanelRecordKey = PanelRecordKey.NewPanelRecordKey(); 10 | 11 | public static PanelRecord GetLeftPanelRecord(PanelsCollection panelsCollection) 12 | { 13 | return panelsCollection.PanelRecordsList 14 | .First(x => 15 | x.PanelRecordKey == LeftPanelRecordKey); 16 | } 17 | 18 | public static PanelRecord GetRightPanelRecord(PanelsCollection panelsCollection) 19 | { 20 | return panelsCollection.PanelRecordsList 21 | .First(x => 22 | x.PanelRecordKey == RightPanelRecordKey); 23 | } 24 | 25 | public static PanelRecord GetBottomPanelRecord(PanelsCollection panelsCollection) 26 | { 27 | return panelsCollection.PanelRecordsList 28 | .First(x => 29 | x.PanelRecordKey == BottomPanelRecordKey); 30 | } 31 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Panel/PanelRecord.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorCommon.RazorLib.Dimensions; 3 | 4 | namespace BlazorStudio.ClassLib.Panel; 5 | 6 | public record PanelRecord( 7 | PanelRecordKey PanelRecordKey, 8 | PanelTabKey ActivePanelTabKey, 9 | ElementDimensions ElementDimensions, 10 | ImmutableArray PanelTabs); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Panel/PanelRecordKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Panel; 2 | 3 | public record PanelRecordKey(Guid Guid) 4 | { 5 | public static readonly PanelRecordKey Empty = new PanelRecordKey(Guid.Empty); 6 | 7 | public static PanelRecordKey NewPanelRecordKey() 8 | { 9 | return new PanelRecordKey(Guid.NewGuid()); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Panel/PanelTab.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dimensions; 2 | 3 | namespace BlazorStudio.ClassLib.Panel; 4 | 5 | /// 6 | /// Each PanelTab maintains its own element dimensions as 7 | /// each panel tab might need different amounts of space to be functionally usable. 8 | /// 9 | public record PanelTab( 10 | PanelTabKey PanelTabKey, 11 | ElementDimensions ElementDimensions, 12 | ElementDimensions BeingDraggedDimensions, 13 | Type ContentRendererType, 14 | Type IconRendererType, 15 | string DisplayName) 16 | { 17 | public bool IsBeingDragged { get; set; } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Panel/PanelTabKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Panel; 2 | 3 | public record PanelTabKey(Guid Guid) 4 | { 5 | public static readonly PanelTabKey Empty = new PanelTabKey(Guid.Empty); 6 | 7 | public static PanelTabKey NewPanelTabKey() 8 | { 9 | return new PanelTabKey(Guid.NewGuid()); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.BackgroundTaskCase; 2 | using BlazorStudio.ClassLib.FileTemplates; 3 | using BlazorStudio.ClassLib.Nuget; 4 | using Fluxor; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace BlazorStudio.ClassLib; 8 | 9 | public static class ServiceCollectionExtensions 10 | { 11 | public static IServiceCollection AddBlazorStudioClassLibServices( 12 | this IServiceCollection services) 13 | { 14 | return services 15 | .AddScoped() 16 | .AddScoped() 17 | .AddScoped() 18 | .AddSingleton() 19 | .AddSingleton() 20 | .AddFluxor(options => 21 | options.ScanAssemblies( 22 | typeof(BlazorCommon.RazorLib.ServiceCollectionExtensions).Assembly, 23 | typeof(BlazorTextEditor.RazorLib.ServiceCollectionExtensions).Assembly, 24 | typeof(ServiceCollectionExtensions).Assembly)); 25 | } 26 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/State/StateKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.State; 2 | 3 | public record StateKey(Guid Guid) 4 | { 5 | public static StateKey Empty { get; } = new(Guid.Empty); 6 | 7 | public static StateKey NewStateKey() 8 | { 9 | return new(Guid.NewGuid()); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/ContextCase/ContextStates.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.Context; 3 | using Fluxor; 4 | 5 | namespace BlazorStudio.ClassLib.Store.ContextCase; 6 | 7 | [FeatureState] 8 | public record ContextStates(ImmutableArray ActiveContextRecords) 9 | { 10 | public ContextStates() : this(ImmutableArray.Empty) 11 | { 12 | ActiveContextRecords = new [] 13 | { 14 | ContextFacts.GlobalContext 15 | }.ToImmutableArray(); 16 | } 17 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/ContextCase/ContextStatesReducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.ContextCase; 4 | 5 | public class ContextStatesReducer 6 | { 7 | [ReducerMethod] 8 | public static ContextStates ReduceSetActiveContextRecordsAction(ContextStates previousContextStates, 9 | SetActiveContextRecordsAction setActiveContextRecordsAction) 10 | { 11 | return previousContextStates with 12 | { 13 | ActiveContextRecords = setActiveContextRecordsAction.ContextRecords 14 | }; 15 | } 16 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/ContextCase/SetActiveContextRecordsAction.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.Context; 3 | 4 | namespace BlazorStudio.ClassLib.Store.ContextCase; 5 | 6 | public record SetActiveContextRecordsAction(ImmutableArray ContextRecords); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/CounterCase/CounterState.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.CounterCase; 4 | 5 | [FeatureState] 6 | public record CounterState(int Count) 7 | { 8 | public CounterState() : this(0) 9 | { 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/CounterCase/CounterStateReducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.CounterCase; 4 | 5 | public class CounterStateReducer 6 | { 7 | [ReducerMethod(typeof(IncrementCounterStateAction))] 8 | public static CounterState ReduceIncrementCounterStateAction(CounterState previousCounterState) 9 | { 10 | return previousCounterState with 11 | { 12 | Count = previousCounterState.Count + 1 13 | }; 14 | } 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/CounterCase/IncrementCounterStateAction.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Store.CounterCase; 2 | 3 | public record IncrementCounterStateAction(); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/DotNetSolutionCase/DotNetSolutionState.Actions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Store.DotNetSolutionCase; 2 | 3 | public partial record DotNetSolutionState 4 | { 5 | public record WithAction(Func WithFunc); 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/DotNetSolutionCase/DotNetSolutionState.Reducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.DotNetSolutionCase; 4 | 5 | public partial record DotNetSolutionState 6 | { 7 | private class Reducer 8 | { 9 | [ReducerMethod] 10 | public DotNetSolutionState ReduceWithAction( 11 | DotNetSolutionState inDotNetSolutionState, 12 | WithAction withAction) 13 | { 14 | return withAction.WithFunc 15 | .Invoke(inDotNetSolutionState); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/FileSystemCase/FileSystemState.Actions.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.Store.FileSystemCase; 4 | 5 | public partial class FileSystemState 6 | { 7 | public record SaveFileAction( 8 | IAbsoluteFilePath AbsoluteFilePath, 9 | string Content, 10 | Action OnAfterSaveCompleted); 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/FolderExplorerCase/FolderExplorerState.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 3 | using BlazorStudio.ClassLib.InputFile; 4 | using BlazorStudio.ClassLib.Store.InputFileCase; 5 | using Fluxor; 6 | 7 | namespace BlazorStudio.ClassLib.Store.FolderExplorerCase; 8 | 9 | [FeatureState] 10 | public record FolderExplorerState(IAbsoluteFilePath? AbsoluteFilePath) 11 | { 12 | public FolderExplorerState() : this(default(IAbsoluteFilePath)) 13 | { 14 | 15 | } 16 | 17 | public static Task ShowInputFileAsync(IDispatcher dispatcher) 18 | { 19 | dispatcher.Dispatch( 20 | new InputFileState.RequestInputFileStateFormAction( 21 | "FolderExplorer", 22 | afp => 23 | { 24 | dispatcher.Dispatch( 25 | new SetFolderExplorerStateAction(afp)); 26 | 27 | return Task.CompletedTask; 28 | }, 29 | afp => 30 | { 31 | if (afp is null || 32 | !afp.IsDirectory) 33 | { 34 | return Task.FromResult(false); 35 | } 36 | 37 | return Task.FromResult(true); 38 | }, 39 | new [] 40 | { 41 | new InputFilePattern( 42 | "Directory", 43 | afp => afp.IsDirectory) 44 | }.ToImmutableArray())); 45 | 46 | return Task.CompletedTask; 47 | } 48 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/FolderExplorerCase/FolderExplorerStateReducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.FolderExplorerCase; 4 | 5 | public class FolderExplorerStateReducer 6 | { 7 | [ReducerMethod] 8 | public FolderExplorerState ReduceSetFolderExplorerStateAction(FolderExplorerState previousFolderExplorerState, 9 | SetFolderExplorerStateAction setFolderExplorerStateAction) 10 | { 11 | return previousFolderExplorerState with 12 | { 13 | AbsoluteFilePath = setFolderExplorerStateAction.AbsoluteFilePath 14 | }; 15 | } 16 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/FolderExplorerCase/SetFolderExplorerStateAction.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.Store.FolderExplorerCase; 4 | 5 | public record SetFolderExplorerStateAction(IAbsoluteFilePath? AbsoluteFilePath); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/FooterCase/FooterState.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Views; 2 | using Fluxor; 3 | 4 | namespace BlazorStudio.ClassLib.Store.FooterCase; 5 | 6 | [FeatureState] 7 | public record FooterState(View ActiveView) 8 | { 9 | public FooterState() : this(ViewFacts.TerminalsView) 10 | { 11 | 12 | } 13 | 14 | public record SetFooterStateViewAction(View View); 15 | 16 | private class FooterStateReducer 17 | { 18 | [ReducerMethod] 19 | public static FooterState ReduceSetFooterStateViewAction( 20 | FooterState inFooterState, 21 | SetFooterStateViewAction setFooterStateViewAction) 22 | { 23 | return inFooterState with 24 | { 25 | ActiveView = setFooterStateViewAction.View 26 | }; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/GitCase/GitState.Actions.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | 3 | namespace BlazorStudio.ClassLib.Store.GitCase; 4 | 5 | public partial record GitState 6 | { 7 | public record SetGitStateWithAction(Func GitStateWithFunc); 8 | 9 | public record TryFindGitFolderInDirectoryAction( 10 | IAbsoluteFilePath DirectoryAbsoluteFilePath, 11 | CancellationToken CancellationToken); 12 | 13 | public record RefreshGitAction(CancellationToken CancellationToken); 14 | public record GitInitAction(CancellationToken CancellationToken); 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/GitCase/GitState.Main.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 3 | using BlazorStudio.ClassLib.Git; 4 | using Fluxor; 5 | 6 | namespace BlazorStudio.ClassLib.Store.GitCase; 7 | 8 | /// 9 | /// The Folder, ".git" may be in the following locations:
10 | /// -In the context of .NET:
11 | /// --The folder containing the user selected .NET Solution
12 | /// --The folder containing the user selected C# Project which is being contained in an adhoc .NET Solution
13 | /// -In the context of using the folder explorer
14 | /// --The folder which is user selected.
15 | ///
16 | [FeatureState] 17 | public partial record GitState( 18 | IAbsoluteFilePath? GitFolderAbsoluteFilePath, 19 | GitState.TryFindGitFolderInDirectoryAction? MostRecentTryFindGitFolderInDirectoryAction, 20 | ImmutableList GitFilesList, 21 | ImmutableList ActiveGitTasks) 22 | { 23 | public GitState() : this( 24 | default(IAbsoluteFilePath?), 25 | default(TryFindGitFolderInDirectoryAction?), 26 | ImmutableList.Empty, 27 | ImmutableList.Empty) 28 | { 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/GitCase/GitState.Reducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.GitCase; 4 | 5 | public partial record GitState 6 | { 7 | private class Reducer 8 | { 9 | [ReducerMethod] 10 | public static GitState ReduceSetGitStateWithAction( 11 | GitState inGitState, 12 | SetGitStateWithAction setGitStateWithAction) 13 | { 14 | return setGitStateWithAction.GitStateWithFunc 15 | .Invoke(inGitState); 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/GitCase/GitTask.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Store.GitCase; 2 | 3 | public record GitTask( 4 | Guid Id, 5 | string DisplayName, 6 | object Action, 7 | CancellationToken CancellationToken); -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/InputFileCase/InputFileState.Actions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorCommon.RazorLib.BackgroundTaskCase; 3 | using BlazorStudio.ClassLib.ComponentRenderers; 4 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 5 | using BlazorStudio.ClassLib.InputFile; 6 | using BlazorStudio.ClassLib.TreeViewImplementations; 7 | 8 | namespace BlazorStudio.ClassLib.Store.InputFileCase; 9 | 10 | public partial record InputFileState 11 | { 12 | public record RequestInputFileStateFormAction(string Message, Func OnAfterSubmitFunc, Func> SelectionIsValidFunc, ImmutableArray InputFilePatterns); 13 | public record SetSelectedTreeViewModelAction(TreeViewAbsoluteFilePath? SelectedTreeViewModel); 14 | public record SetOpenedTreeViewModelAction(TreeViewAbsoluteFilePath TreeViewModel, IBlazorStudioComponentRenderers BlazorStudioComponentRenderers, IFileSystemProvider FileSystemProvider, IEnvironmentProvider EnvironmentProvider); 15 | public record SetSelectedInputFilePatternAction(InputFilePattern InputFilePattern); 16 | public record SetSearchQueryAction(string SearchQuery); 17 | public record MoveBackwardsInHistoryAction; 18 | public record MoveForwardsInHistoryAction; 19 | public record OpenParentDirectoryAction(IBlazorStudioComponentRenderers BlazorStudioComponentRenderers, IFileSystemProvider FileSystemProvider, IEnvironmentProvider EnvironmentProvider, IBackgroundTaskQueue BackgroundTaskQueue); 20 | public record RefreshCurrentSelectionAction(IBackgroundTaskQueue BackgroundTaskQueue); 21 | public record StartInputFileStateFormAction(RequestInputFileStateFormAction RequestInputFileStateFormAction); 22 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/InputFileCase/InputFileState.Main.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 3 | using BlazorStudio.ClassLib.InputFile; 4 | using BlazorStudio.ClassLib.TreeViewImplementations; 5 | using Fluxor; 6 | 7 | namespace BlazorStudio.ClassLib.Store.InputFileCase; 8 | 9 | [FeatureState] 10 | public partial record InputFileState( 11 | int IndexInHistory, 12 | ImmutableList OpenedTreeViewModelHistory, 13 | TreeViewAbsoluteFilePath? SelectedTreeViewModel, 14 | Func OnAfterSubmitFunc, 15 | Func> SelectionIsValidFunc, 16 | ImmutableArray InputFilePatterns, 17 | InputFilePattern? SelectedInputFilePattern, 18 | string SearchQuery, 19 | string Message) 20 | { 21 | private InputFileState() : this( 22 | -1, 23 | ImmutableList.Empty, 24 | null, 25 | _ => Task.CompletedTask, 26 | _ => Task.FromResult(false), 27 | ImmutableArray.Empty, 28 | null, 29 | string.Empty, 30 | string.Empty) 31 | { 32 | } 33 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/LocalStorageCase/LocalStorageEffects.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | using Microsoft.JSInterop; 3 | 4 | namespace BlazorStudio.ClassLib.Store.LocalStorageCase; 5 | 6 | public class LocalStorageEffects 7 | { 8 | private readonly IJSRuntime _jsRuntime; 9 | 10 | public LocalStorageEffects(IJSRuntime jsRuntime) 11 | { 12 | _jsRuntime = jsRuntime; 13 | } 14 | 15 | public record LocalStorageSetItemAction(string Key, string Value); 16 | 17 | [EffectMethod] 18 | public async Task HandleLocalStorageSetItemAction( 19 | LocalStorageSetItemAction localStorageSetItemAction, 20 | IDispatcher dispatcher) 21 | { 22 | await _jsRuntime.InvokeVoidAsync( 23 | "blazorStudio.localStorageSetItem", 24 | localStorageSetItemAction.Key, 25 | localStorageSetItemAction.Value); 26 | } 27 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/NugetPackageManagerCase/NuGetPackageManagerState.Actions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.DotNet; 3 | using BlazorStudio.ClassLib.Nuget; 4 | 5 | namespace BlazorStudio.ClassLib.Store.NugetPackageManagerCase; 6 | 7 | public partial record NuGetPackageManagerState 8 | { 9 | public record SetSelectedProjectToModifyAction(IDotNetProject? SelectedProjectToModify); 10 | public record SetNugetQueryAction(string NugetQuery); 11 | public record SetIncludePrereleaseAction(bool IncludePrerelease); 12 | public record SetMostRecentQueryResultAction(ImmutableArray QueryResult); 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/NugetPackageManagerCase/NuGetPackageManagerState.Main.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.DotNet; 3 | using BlazorStudio.ClassLib.Nuget; 4 | using Fluxor; 5 | 6 | namespace BlazorStudio.ClassLib.Store.NugetPackageManagerCase; 7 | 8 | [FeatureState] 9 | public partial record NuGetPackageManagerState( 10 | IDotNetProject? SelectedProjectToModify, 11 | string NugetQuery, 12 | bool IncludePrerelease, 13 | ImmutableArray MostRecentQueryResult) 14 | { 15 | public NuGetPackageManagerState() 16 | : this( 17 | default(IDotNetProject?), 18 | string.Empty, 19 | false, 20 | ImmutableArray.Empty) 21 | { 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/PanelCase/PanelsCollection.Actions.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Panel; 2 | 3 | namespace BlazorStudio.ClassLib.Store.PanelCase; 4 | 5 | public partial record PanelsCollection 6 | { 7 | public record RegisterPanelRecordAction(PanelRecord PanelRecord); 8 | public record DisposePanelRecordAction(PanelRecordKey PanelRecordKey); 9 | 10 | public record RegisterPanelTabAction(PanelRecordKey PanelRecordKey, PanelTab PanelTab); 11 | public record DisposePanelTabAction(PanelRecordKey PanelRecordKey, PanelTabKey PanelTabKey); 12 | 13 | public record SetActivePanelTabAction(PanelRecordKey PanelRecordKey, PanelTabKey PanelTabKey); 14 | 15 | public record SetPanelDragEventArgsAction((PanelTab TagDragTarget, PanelRecord ParentPanelRecord)? PanelDragEventArgs); 16 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/ProgramExecutionCase/ProgramExecutionState.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | using Fluxor; 3 | 4 | namespace BlazorStudio.ClassLib.Store.ProgramExecutionCase; 5 | 6 | [FeatureState] 7 | public record ProgramExecutionState(IAbsoluteFilePath? StartupProjectAbsoluteFilePath) 8 | { 9 | private ProgramExecutionState() : this(default(IAbsoluteFilePath)) 10 | { 11 | 12 | } 13 | 14 | public record SetStartupProjectAbsoluteFilePathAction(IAbsoluteFilePath? StartupProjectAbsoluteFilePath); 15 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/ProgramExecutionCase/ProgramExecutionStateReducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.ProgramExecutionCase; 4 | 5 | public class ProgramExecutionStateReducer 6 | { 7 | [ReducerMethod] 8 | public static ProgramExecutionState ReduceSetStartupProjectAbsoluteFilePathAction( 9 | ProgramExecutionState inProgramExecutionState, 10 | ProgramExecutionState.SetStartupProjectAbsoluteFilePathAction setStartupProjectAbsoluteFilePathAction) 11 | { 12 | return inProgramExecutionState with 13 | { 14 | StartupProjectAbsoluteFilePath = 15 | setStartupProjectAbsoluteFilePathAction.StartupProjectAbsoluteFilePath 16 | }; 17 | } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalCommand.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 2 | 3 | public record TerminalCommand( 4 | TerminalCommandKey TerminalCommandKey, 5 | string TargetFilePath, 6 | IEnumerable Arguments, 7 | string? ChangeWorkingDirectoryTo = null, 8 | CancellationToken CancellationToken = default, 9 | Func? ContinueWith = null); 10 | -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalCommandKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 2 | 3 | public record TerminalCommandKey(Guid Guid, string? DisplayName) 4 | { 5 | public static TerminalCommandKey Empty { get; } = new(Guid.Empty, null); 6 | 7 | public static TerminalCommandKey NewTerminalCommandKey(string? displayName = null) 8 | { 9 | return new(Guid.NewGuid(), displayName); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalSessionFacts.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 4 | 5 | public static class TerminalSessionFacts 6 | { 7 | public static readonly TerminalSessionKey EXECUTION_TERMINAL_SESSION_KEY = 8 | TerminalSessionKey.NewTerminalSessionKey("Execution"); 9 | 10 | public static readonly TerminalSessionKey GENERAL_TERMINAL_SESSION_KEY = 11 | TerminalSessionKey.NewTerminalSessionKey("General"); 12 | 13 | public static readonly ImmutableArray WELL_KNOWN_TERMINAL_SESSION_KEYS = new[] 14 | { 15 | EXECUTION_TERMINAL_SESSION_KEY, 16 | GENERAL_TERMINAL_SESSION_KEY 17 | }.ToImmutableArray(); 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalSessionKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 2 | 3 | public record TerminalSessionKey(Guid Guid, string? DisplayName) 4 | { 5 | public static TerminalSessionKey Empty { get; } = new(Guid.Empty, null); 6 | 7 | public static TerminalSessionKey NewTerminalSessionKey(string? displayName = null) 8 | { 9 | return new(Guid.NewGuid(), displayName); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalSessionWasModifiedState.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.State; 3 | using Fluxor; 4 | 5 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 6 | 7 | [FeatureState] 8 | public record TerminalSessionWasModifiedState(ImmutableDictionary TerminalSessionWasModifiedMap) 9 | { 10 | public TerminalSessionWasModifiedState() 11 | : this(ImmutableDictionary.Empty) 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalSessionWasModifiedStateReducer.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.State; 2 | using Fluxor; 3 | 4 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 5 | 6 | public class TerminalSessionWasModifiedStateReducer 7 | { 8 | public record SetTerminalSessionStateKeyAction( 9 | TerminalSessionKey TerminalSessionKey, 10 | StateKey StateKey); 11 | 12 | [ReducerMethod] 13 | public static TerminalSessionWasModifiedState ReduceSetTerminalSessionStateKeyAction( 14 | TerminalSessionWasModifiedState inTerminalSessionWasModifiedState, 15 | SetTerminalSessionStateKeyAction setTerminalSessionStateKeyAction) 16 | { 17 | if (inTerminalSessionWasModifiedState.TerminalSessionWasModifiedMap.ContainsKey( 18 | setTerminalSessionStateKeyAction.TerminalSessionKey)) 19 | { 20 | var nextMap = inTerminalSessionWasModifiedState.TerminalSessionWasModifiedMap 21 | .SetItem( 22 | setTerminalSessionStateKeyAction.TerminalSessionKey, 23 | setTerminalSessionStateKeyAction.StateKey); 24 | 25 | return inTerminalSessionWasModifiedState with 26 | { 27 | TerminalSessionWasModifiedMap = nextMap 28 | }; 29 | } 30 | else 31 | { 32 | var nextMap = inTerminalSessionWasModifiedState.TerminalSessionWasModifiedMap 33 | .Add( 34 | setTerminalSessionStateKeyAction.TerminalSessionKey, 35 | setTerminalSessionStateKeyAction.StateKey); 36 | 37 | return inTerminalSessionWasModifiedState with 38 | { 39 | TerminalSessionWasModifiedMap = nextMap 40 | }; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/TerminalSessionsState.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using Fluxor; 3 | 4 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 5 | 6 | [FeatureState] 7 | public record TerminalSessionsState(ImmutableDictionary TerminalSessionMap) 8 | { 9 | public TerminalSessionsState() 10 | : this(ImmutableDictionary.Empty) 11 | { 12 | } 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/WellKnownTerminalSessionsState.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 4 | 5 | [FeatureState] 6 | public record WellKnownTerminalSessionsState(TerminalSessionKey ActiveTerminalSessionKey) 7 | { 8 | public WellKnownTerminalSessionsState() : this(TerminalSessionFacts.GENERAL_TERMINAL_SESSION_KEY) 9 | { 10 | } 11 | 12 | public record SetActiveWellKnownTerminalSessionKey(TerminalSessionKey TerminalCommandKey); 13 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Store/TerminalCase/WellKnownTerminalSessionsStateReducer.cs: -------------------------------------------------------------------------------- 1 | using Fluxor; 2 | 3 | namespace BlazorStudio.ClassLib.Store.TerminalCase; 4 | 5 | public class WellKnownTerminalSessionsStateReducer 6 | { 7 | [ReducerMethod] 8 | public static WellKnownTerminalSessionsState ReduceSetActiveTerminalCommandKeyAction( 9 | WellKnownTerminalSessionsState inWellKnownTerminalSessionsState, 10 | WellKnownTerminalSessionsState.SetActiveWellKnownTerminalSessionKey setActiveWellKnownTerminalCommandKeyAction) 11 | { 12 | return inWellKnownTerminalSessionsState with 13 | { 14 | ActiveTerminalSessionKey = setActiveWellKnownTerminalCommandKeyAction 15 | .TerminalCommandKey 16 | }; 17 | } 18 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/TreeViewImplementations/Helper/TreeViewHelper.Main.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.TreeViewImplementations.Helper; 2 | 3 | public static partial class TreeViewHelper 4 | { 5 | public const char NAMESPACE_DELIMITER = '.'; 6 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Views/View.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Views; 2 | 3 | /// 4 | /// Views should use DependencyInjection for data 5 | /// 6 | public class View 7 | { 8 | public View(ViewKey viewKey, ViewKind viewKind) 9 | { 10 | ViewKey = viewKey; 11 | ViewKind = viewKind; 12 | } 13 | 14 | public ViewKey ViewKey { get; } 15 | public ViewKind ViewKind { get; } 16 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Views/ViewFacts.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace BlazorStudio.ClassLib.Views; 4 | 5 | public static class ViewFacts 6 | { 7 | public static readonly View TerminalsView = new( 8 | ViewKey.NewViewKey("Terminals"), 9 | ViewKind.Terminals); 10 | 11 | public static readonly View NugetPackageManagerView = new( 12 | ViewKey.NewViewKey("NuGet"), 13 | ViewKind.NugetPackageManager); 14 | 15 | public static readonly View GitView = new( 16 | ViewKey.NewViewKey("Git"), 17 | ViewKind.GitDisplay); 18 | 19 | public static readonly ImmutableArray Views = new[] 20 | { 21 | TerminalsView, 22 | NugetPackageManagerView, 23 | GitView 24 | }.ToImmutableArray(); 25 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Views/ViewKey.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Views; 2 | 3 | public record ViewKey(Guid Guid, string? DisplayName) 4 | { 5 | public static ViewKey Empty { get; } = new(Guid.Empty, null); 6 | 7 | public static ViewKey NewViewKey(string? displayName = null) 8 | { 9 | return new(Guid.NewGuid(), displayName); 10 | } 11 | } -------------------------------------------------------------------------------- /BlazorStudio.ClassLib/Views/ViewKind.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.ClassLib.Views; 2 | 3 | public enum ViewKind 4 | { 5 | Terminals, 6 | NugetPackageManager, 7 | GitDisplay, 8 | } -------------------------------------------------------------------------------- /BlazorStudio.Photino/App.razor: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /BlazorStudio.Photino/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.JSInterop -------------------------------------------------------------------------------- /BlazorStudio.Photino/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/BlazorStudio.Photino/favicon.ico -------------------------------------------------------------------------------- /BlazorStudio.Photino/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 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 13 | all 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 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/BlazorStudio.Photino/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /BlazorStudio.Photino/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Loading... 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Adhoc/AdhocDisplay.razor: -------------------------------------------------------------------------------- 1 | 
3 | 4 |
5 | Adhoc Display 6 |
7 | 8 |
10 | 11 |
12 | 16 |
17 | 18 |
19 | 20 | @@BackgroundTaskMonitor.ExecutingBackgroundTask: 21 | 22 |   23 | 24 | @if (BackgroundTaskMonitor.ExecutingBackgroundTask is null) 25 | { 26 | @: null 27 | } 28 | else 29 | { 30 | @BackgroundTaskMonitor.ExecutingBackgroundTask.Name 31 | } 32 |
33 |
34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/BlazorStudioInitializer.razor: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/BlazorStudioOptions.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorStudio.RazorLib; 2 | 3 | public record BlazorStudioOptions( 4 | bool IsNativeApplication); -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Button/ButtonDisplay.razor: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Button/ButtonDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorStudio.RazorLib.Button; 4 | 5 | public partial class ButtonDisplay : ComponentBase 6 | { 7 | [Parameter, EditorRequired] 8 | public Func OnClickFunc { get; set; } = null!; 9 | [Parameter, EditorRequired] 10 | public RenderFragment ChildContent { get; set; } = null!; 11 | [Parameter] 12 | public bool OnClickStopPropagation { get; set; } 13 | [Parameter] 14 | public bool IsDisabled { get; set; } 15 | [Parameter] 16 | public string CssClassString { get; set; } = string.Empty; 17 | [Parameter] 18 | public string CssStyleString { get; set; } = string.Empty; 19 | 20 | private ElementReference? _buttonElementReference; 21 | 22 | public ElementReference? ButtonElementReference => _buttonElementReference; 23 | 24 | private string IsDisabledCssClass => IsDisabled 25 | ? "bcrl_disabled" 26 | : string.Empty; 27 | 28 | public async Task FireOnClickAction() 29 | { 30 | await OnClickFunc.Invoke(); 31 | } 32 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/CSharpProjectForm/RemoveCSharpProjectFromSolutionDisplay.razor: -------------------------------------------------------------------------------- 1 | 
3 | 4 |
5 | 6 | Remove C# Project: 7 | 8 | 9 |
10 | 11 | @AbsoluteFilePath.FilenameWithExtension 12 | 13 |
14 |
15 | 16 |
17 | 18 | Delete 19 | 20 | 21 | 23 | Cancel 24 | 25 |
26 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/ContextCase/ContextBoundary.razor: -------------------------------------------------------------------------------- 1 |
6 | 7 | 8 | @ChildContent 9 | 10 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/ContextCase/ContextBoundary.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorStudio.ClassLib.Context; 3 | using BlazorStudio.ClassLib.Store.ContextCase; 4 | using Fluxor; 5 | using Microsoft.AspNetCore.Components; 6 | 7 | namespace BlazorStudio.RazorLib.ContextCase; 8 | 9 | public partial class ContextBoundary : ComponentBase 10 | { 11 | [Inject] 12 | private IDispatcher Dispatcher { get; set; } = null!; 13 | 14 | [CascadingParameter] 15 | public ContextBoundary? ParentContextBoundary { get; set; } 16 | 17 | [Parameter, EditorRequired] 18 | public ContextRecord ContextRecord { get; set; } = null!; 19 | [Parameter, EditorRequired] 20 | public RenderFragment ChildContent { get; set; } = null!; 21 | [Parameter] 22 | public string ClassCssString { get; set; } = null!; 23 | [Parameter] 24 | public string StyleCssString { get; set; } = null!; 25 | [Parameter] 26 | public int TabIndex { get; set; } = -1; 27 | 28 | public void DispatchSetActiveContextStatesAction(List contextRecords) 29 | { 30 | contextRecords.Add(ContextRecord); 31 | 32 | if (ParentContextBoundary is not null) 33 | { 34 | ParentContextBoundary.DispatchSetActiveContextStatesAction(contextRecords); 35 | } 36 | else 37 | { 38 | Dispatcher.Dispatch(new SetActiveContextRecordsAction(contextRecords.ToImmutableArray())); 39 | } 40 | } 41 | 42 | public void HandleOnFocusIn() 43 | { 44 | DispatchSetActiveContextStatesAction(new()); 45 | } 46 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/CounterCase/CounterDisplay.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | 3 | 5 | @CounterStateWrap.Value.Count 6 | 7 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/CounterCase/CounterDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Store.CounterCase; 2 | using Fluxor; 3 | using Fluxor.Blazor.Web.Components; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace BlazorStudio.RazorLib.CounterCase; 7 | 8 | public partial class CounterDisplay : FluxorComponent 9 | { 10 | [Inject] 11 | private IState CounterStateWrap { get; set; } = null!; 12 | [Inject] 13 | private IDispatcher Dispatcher { get; set; } = null!; 14 | 15 | private void DispatchIncrementCounterStateAction() 16 | { 17 | Dispatcher.Dispatch(new IncrementCounterStateAction()); 18 | } 19 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Editor/EditorDisplay.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.ClassLib.Context 2 | @using BlazorStudio.ClassLib.Store.EditorCase 3 | @using BlazorStudio.RazorLib.ContextCase 4 | @using BlazorTextEditor.RazorLib 5 | @using BlazorTextEditor.RazorLib.HelperComponents 6 | @using BlazorTextEditor.RazorLib.Group 7 | 8 | 11 | 12 |
13 | Editor 14 |
15 | 16 |
17 | 20 |
21 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Editor/EditorDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | using BlazorCommon.RazorLib.Dimensions; 3 | using BlazorTextEditor.RazorLib.HelperComponents; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace BlazorStudio.RazorLib.Editor; 7 | 8 | public partial class EditorDisplay : ComponentBase 9 | { 10 | [Parameter, EditorRequired] 11 | public ElementDimensions EditorElementDimensions { get; set; } = null!; 12 | 13 | private static readonly ImmutableArray TextEditorHeaderButtonKinds = 14 | Enum 15 | .GetValues(typeof(TextEditorHeaderButtonKind)) 16 | .Cast() 17 | .ToImmutableArray(); 18 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/File/DeleteFileFormDisplay.razor: -------------------------------------------------------------------------------- 1 | 
3 | 4 |
5 | @* "Delete" or "Delete Recursively" *@ 6 | 7 | Delete 8 | @if (AbsoluteFilePath.IsDirectory) 9 | { 10 |  Recursively 11 | } 12 | 13 | 14 | : 15 |   16 | 17 | 18 | @AbsoluteFilePath.FilenameWithExtension 19 | 20 | 21 | @if (AbsoluteFilePath.IsDirectory) 22 | { 23 |
24 | AND 25 | 26 | AT LEAST 27 | @_countOfImmediateChildren 28 | 29 | child files. 30 |
31 | } 32 |
33 | 34 |
35 | 36 | Delete 37 | 38 | 39 | 41 | Cancel 42 | 43 |
44 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/File/FileFormDisplay.razor: -------------------------------------------------------------------------------- 1 | 
3 | 4 | @if (CheckForTemplates) 5 | { 6 | 8 | } 9 | 10 | 21 |
22 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/File/FileIconDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | using Microsoft.AspNetCore.Components; 3 | 4 | namespace BlazorStudio.RazorLib.File; 5 | 6 | public partial class FileIconDisplay : ComponentBase 7 | { 8 | [Parameter, EditorRequired] 9 | public IAbsoluteFilePath AbsoluteFilePath { get; set; } = null!; 10 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/File/FileTemplatesDisplay.razor: -------------------------------------------------------------------------------- 1 | @{ 2 | _exactMatchWrapper = _fileTemplatesFormWrappers 3 | .FirstOrDefault(x => 4 | x.FileTemplate.IsExactTemplate.Invoke(FileName)); 5 | 6 | GetRelatedFileTemplates(); 7 | 8 | foreach (var relatedMatchWrapper in _relatedMatchWrappers) 9 | { 10 |
11 | @relatedMatchWrapper.FileTemplate.DisplayName? 12 |
13 | } 14 | } 15 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/FolderExplorer/InternalComponents/FolderExplorerContextMenu.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCommon.RazorLib.Menu 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/FormsGeneric/BooleanPromptOrCancelDisplay.razor: -------------------------------------------------------------------------------- 1 | 
3 | 4 |
5 | @Message 6 |
7 | 8 |
9 | 10 | @(AcceptOptionTextOverride ?? "Accept") 11 | 12 | 13 | 15 | @(DeclineOptionTextOverride ?? "Decline") 16 | 17 | 18 | @if (IncludeCancelOption) 19 | { 20 | 21 | Cancel 22 | 23 | } 24 |
25 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileAddressHierarchyEntry.razor: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileAddressHierarchyEntry.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 2 | using Microsoft.AspNetCore.Components; 3 | 4 | namespace BlazorStudio.RazorLib.InputFile.InternalComponents; 5 | 6 | public partial class InputFileAddressHierarchyEntry : ComponentBase 7 | { 8 | [Parameter, EditorRequired] 9 | public IAbsoluteFilePath AbsoluteFilePath { get; set; } = null!; 10 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileBottomControls.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.ClassLib.Store.InputFileCase 2 | 3 |
4 |
5 |
6 | @GetSelectedTreeViewModelAbsoluteFilePathString(InputFileState) 7 |
8 |
9 | (@InputFileState.Message) 10 |
11 |
12 |
13 |
14 | 25 |
26 |
27 | 29 | Select 30 | 31 | 32 | 33 | Cancel 34 | 35 |
36 |
37 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileContent.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCommon.RazorLib.TreeView.Displays 2 | 3 |
5 | 6 | 7 | 11 | 12 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileContextMenu.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCommon.RazorLib.Menu 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileEditAddress.razor: -------------------------------------------------------------------------------- 1 | 
3 | 4 | 8 | 9 | 14 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/InputFile/InternalComponents/InputFileSidebar.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCommon.RazorLib.TreeView.Displays 2 | @using BlazorCommon.RazorLib.Dropdown 3 | 4 |
6 | 7 | 8 | 13 | 14 | 15 | 18 | 19 | 20 | 21 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Notification/NotificationHistoryDisplay.razor: -------------------------------------------------------------------------------- 1 | 

NotificationHistoryDisplay

2 | 3 | @code { 4 | 5 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Notification/NotificationHistoryDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorStudio.RazorLib.Notification; 4 | 5 | public partial class NotificationHistoryDisplay : ComponentBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/NuGet/NugetPackageDisplay.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | 3 |
4 | 5 |
6 | @NugetPackageRecord.Title 7 | (@($"{NugetPackageRecord.TotalDownloads:N0}") Downloads) 8 | 9 |
10 | 21 | 22 | @{ 23 | var buttonIsDisabled = !ValidateSolutionContainsSelectedProject(); 24 | } 25 | 26 | 29 | 30 | @if (buttonIsDisabled) 31 | { 32 | 33 | Must select a Project to Modify 34 | 35 | } 36 | else 37 | { 38 | 39 | Add to @NuGetPackageManagerStateWrap.Value.SelectedProjectToModify.DisplayName 40 | 41 | } 42 | 43 |
44 |
45 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Pages/Authentication.razor: -------------------------------------------------------------------------------- 1 | @page "/authentication/{action}" 2 | @using Microsoft.AspNetCore.Components.WebAssembly.Authentication 3 | 4 | 5 | @code{ 6 | [Parameter] 7 | public string? Action { get; set; } 8 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Pages/EditorPage.razor: -------------------------------------------------------------------------------- 1 | @page "/editor" 2 | @using BlazorCommon.RazorLib.Dimensions 3 | @using BlazorStudio.ClassLib.Panel 4 | @using BlazorStudio.RazorLib.Panel 5 | @using BlazorStudio.RazorLib.Shared 6 | @using BlazorCommon.RazorLib.Resize 7 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Pages/EditorPage.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dimensions; 2 | using BlazorCommon.RazorLib.Resize; 3 | using BlazorStudio.ClassLib.Dimensions; 4 | using BlazorStudio.ClassLib.Store.PanelCase; 5 | using Fluxor; 6 | using Microsoft.AspNetCore.Components; 7 | 8 | namespace BlazorStudio.RazorLib.Pages; 9 | 10 | public partial class EditorPage : ComponentBase 11 | { 12 | [Inject] 13 | private IState PanelsCollectionWrap { get; set; } = null!; 14 | 15 | private ElementDimensions _bodyElementDimensions = new(); 16 | 17 | protected override void OnInitialized() 18 | { 19 | var bodyHeight = _bodyElementDimensions.DimensionAttributes 20 | .Single(da => da.DimensionAttributeKind == DimensionAttributeKind.Height); 21 | 22 | bodyHeight.DimensionUnits.AddRange(new [] 23 | { 24 | new DimensionUnit 25 | { 26 | Value = 78, 27 | DimensionUnitKind = DimensionUnitKind.Percentage 28 | }, 29 | new DimensionUnit 30 | { 31 | Value = ResizableRow.RESIZE_HANDLE_HEIGHT_IN_PIXELS / 2, 32 | DimensionUnitKind = DimensionUnitKind.Pixels, 33 | DimensionOperatorKind = DimensionOperatorKind.Subtract 34 | }, 35 | new DimensionUnit 36 | { 37 | Value = SizeFacts.Bstudio.Header.Height.Value / 2, 38 | DimensionUnitKind = SizeFacts.Bstudio.Header.Height.DimensionUnitKind, 39 | DimensionOperatorKind = DimensionOperatorKind.Subtract 40 | } 41 | }); 42 | 43 | base.OnInitialized(); 44 | } 45 | 46 | private async Task ReRenderAsync() 47 | { 48 | await InvokeAsync(StateHasChanged); 49 | } 50 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using BlazorStudio.RazorLib.FolderExplorer 3 | 4 | Index 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Panel/PanelTabDisplay.razor: -------------------------------------------------------------------------------- 1 |  25 | 26 | @if (PanelTab.IsBeingDragged) 27 | { 28 |
30 | @PanelTab.DisplayName 31 |
32 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Settings/SettingsDialogEntryPoint.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Settings/SettingsDialogEntryPoint.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dialog; 2 | using BlazorCommon.RazorLib.Store.DialogCase; 3 | using Fluxor; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace BlazorStudio.RazorLib.Settings; 7 | 8 | public partial class SettingsDialogEntryPoint : ComponentBase 9 | { 10 | [Inject] 11 | private IDispatcher Dispatcher { get; set; } = null!; 12 | 13 | private DialogRecord _dialogRecord = new( 14 | DialogKey.NewDialogKey(), 15 | "Settings", 16 | typeof(SettingsDisplay), 17 | null, 18 | null) 19 | { 20 | IsResizable = true 21 | }; 22 | 23 | public void DispatchRegisterDialogRecordAction() 24 | { 25 | Dispatcher.Dispatch( 26 | new DialogRecordsCollection.RegisterAction( 27 | _dialogRecord)); 28 | } 29 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Settings/SettingsDisplay.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCommon.RazorLib.Options 2 | @using BlazorTextEditor.RazorLib.Options 3 | 4 |
5 | 6 |
7 |
8 | Application Settings 9 |
10 | 11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 |
23 |
24 | Text Editor Settings 25 |
26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Settings/SettingsDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dialog; 2 | using Microsoft.AspNetCore.Components; 3 | 4 | namespace BlazorStudio.RazorLib.Settings; 5 | 6 | public partial class SettingsDisplay : ComponentBase 7 | { 8 | public static readonly DialogKey SettingsDialogKey = DialogKey.NewDialogKey(); 9 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Settings/SettingsDisplay.razor.css: -------------------------------------------------------------------------------- 1 | .bstudio_settings { 2 | padding: 5px; 3 | } 4 | 5 | .bstudio_settings-scope-border { 6 | padding: 0 !important; 7 | background-color: var(--bcrl_primary-border-color); 8 | opacity: 0.7; 9 | position: absolute; 10 | left: 0; 11 | top: 0; 12 | width: 2px; 13 | height: 100%; 14 | margin-left: 6px; 15 | } 16 | 17 | .bstudio_settings-scope-title { 18 | color: var(--bcrl_primary-emphasis-foreground-color); 19 | } 20 | 21 | .bstudio_settings-scope-body { 22 | position: relative; 23 | padding-left: 12px; 24 | } 25 | 26 | .bstudio_settings-scope-body > div { 27 | padding: 7px 5px; 28 | margin-bottom: 7px; 29 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/ActiveContextRecordsDisplay.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | 3 |
4 | 5 | Context:  6 | @foreach (var contextRecord in ContextStatesWrap.Value.ActiveContextRecords) 7 | { 8 | @contextRecord.DisplayNameFriendly ->  9 | } 10 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/ActiveContextRecordsDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Store.ContextCase; 2 | using Fluxor; 3 | using Fluxor.Blazor.Web.Components; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace BlazorStudio.RazorLib.Shared; 7 | 8 | public partial class ActiveContextRecordsDisplay : FluxorComponent 9 | { 10 | [Inject] 11 | private IState ContextStatesWrap { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorBody.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.RazorLib.Editor 2 | @using BlazorStudio.RazorLib.FolderExplorer 3 | @using BlazorCommon.RazorLib.Resize 4 | @using BlazorStudio.ClassLib.Panel 5 | @using BlazorStudio.RazorLib.Panel 6 | @using BlazorCommon.RazorLib.Dimensions 7 | 8 |
10 | 11 | 15 | 16 | 19 | 20 | 21 | 22 | 25 | 26 | 30 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorBody.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dimensions; 2 | using BlazorCommon.RazorLib.Resize; 3 | using BlazorStudio.ClassLib.Store.PanelCase; 4 | using Fluxor; 5 | using Microsoft.AspNetCore.Components; 6 | 7 | namespace BlazorStudio.RazorLib.Shared; 8 | 9 | public partial class BlazorTextEditorBody : ComponentBase 10 | { 11 | [Inject] 12 | private IState PanelsCollectionWrap { get; set; } = null!; 13 | 14 | [Parameter, EditorRequired] 15 | public ElementDimensions BodyElementDimensions { get; set; } = null!; 16 | 17 | private ElementDimensions _editorElementDimensions = new(); 18 | 19 | protected override void OnInitialized() 20 | { 21 | var editorWidth = _editorElementDimensions.DimensionAttributes 22 | .Single(da => da.DimensionAttributeKind == DimensionAttributeKind.Width); 23 | 24 | editorWidth.DimensionUnits.AddRange(new [] 25 | { 26 | new DimensionUnit 27 | { 28 | Value = 33.3333, 29 | DimensionUnitKind = DimensionUnitKind.Percentage 30 | }, 31 | new DimensionUnit 32 | { 33 | Value = ResizableColumn.RESIZE_HANDLE_WIDTH_IN_PIXELS / 2, 34 | DimensionUnitKind = DimensionUnitKind.Pixels, 35 | DimensionOperatorKind = DimensionOperatorKind.Subtract 36 | } 37 | }); 38 | 39 | base.OnInitialized(); 40 | } 41 | 42 | private async Task ReRenderAsync() 43 | { 44 | await InvokeAsync(StateHasChanged); 45 | } 46 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorExplorers.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.RazorLib.SolutionExplorer 2 | @using BlazorStudio.RazorLib.FolderExplorer 3 | @using BlazorCommon.RazorLib.Resize 4 | 5 |
7 | 8 | 9 | 10 | 13 | 14 | 15 |
16 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorFooter.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.ClassLib.Context 2 | @using BlazorStudio.ClassLib.Views 3 | @using BlazorStudio.RazorLib.Terminal 4 | @using BlazorStudio.RazorLib.NuGet 5 | @using BlazorStudio.RazorLib.Git 6 | 7 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 8 | 9 | 12 | 13 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorFooter.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.Dimensions; 2 | using BlazorStudio.ClassLib.Store.FooterCase; 3 | using Fluxor; 4 | using Fluxor.Blazor.Web.Components; 5 | using Microsoft.AspNetCore.Components; 6 | 7 | namespace BlazorStudio.RazorLib.Shared; 8 | 9 | public partial class BlazorTextEditorFooter : FluxorComponent 10 | { 11 | [Inject] 12 | private IState FooterStateWrap { get; set; } = null!; 13 | 14 | [Parameter, EditorRequired] 15 | public ElementDimensions FooterElementDimensions { get; set; } = null!; 16 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorFooterViewTabs.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.ClassLib.Views 2 | 3 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorFooterViewTabs.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorStudio.RazorLib.Shared; 4 | 5 | public partial class BlazorTextEditorFooterViewTabs : ComponentBase 6 | { 7 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/BlazorTextEditorHeader.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | @using BlazorStudio.ClassLib.Context 3 | @using BlazorStudio.RazorLib.Settings 4 | @using BlazorStudio.RazorLib.StartupControls 5 | @using BlazorCommon.RazorLib.Dropdown 6 | @using BlazorCommon.RazorLib.Menu 7 | 8 | 11 | 12 |
14 | 15 | 16 | 17 | 20 | File 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 | 34 |
36 | 37 | @* *@ 38 |
39 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.ClassLib.Context 2 | @using BlazorStudio.RazorLib.ContextCase 3 | @using BlazorTextEditor.RazorLib 4 | @using BlazorCommon.RazorLib.Drag 5 | @using BlazorCommon.RazorLib.Dialog 6 | @using BlazorCommon.RazorLib.Dimensions 7 | @using BlazorCommon.RazorLib.Notification 8 | @using BlazorCommon.RazorLib.Resize 9 | @using BlazorStudio.ClassLib.Panel 10 | @using BlazorStudio.RazorLib.Panel 11 | 12 | @inherits LayoutComponentBase 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 36 | 37 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/ViewTabDisplay.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | 3 | 5 | 6 | @View.ViewKey.DisplayName 7 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Shared/ViewTabDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Store.FooterCase; 2 | using BlazorStudio.ClassLib.Views; 3 | using Fluxor; 4 | using Fluxor.Blazor.Web.Components; 5 | using Microsoft.AspNetCore.Components; 6 | 7 | namespace BlazorStudio.RazorLib.Shared; 8 | 9 | public partial class ViewTabDisplay : FluxorComponent 10 | { 11 | [Inject] 12 | private IState FooterStateWrap { get; set; } = null!; 13 | [Inject] 14 | private IDispatcher Dispatcher { get; set; } = null!; 15 | 16 | [Parameter, EditorRequired] 17 | public View View { get; set; } = null!; 18 | 19 | private bool IsActive => FooterStateWrap.Value.ActiveView.ViewKey == 20 | View.ViewKey; 21 | 22 | private string IsActiveCssClass => IsActive 23 | ? "bcrl_active" 24 | : string.Empty; 25 | 26 | private void DispatchSetActiveViewAction() 27 | { 28 | Dispatcher.Dispatch(new FooterState.SetFooterStateViewAction( 29 | View)); 30 | } 31 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/SolutionExplorer/SolutionExplorerContextMenu.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCommon.RazorLib.Menu 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/StartupControls/StartupControlsDisplay.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | 3 |
4 |
5 | MSBuild:  6 |
7 |
8 | StartupProject:  9 | @(ProgramExecutionStateWrap.Value.StartupProjectAbsoluteFilePath?.FileNameNoExtension ?? "null") 10 |
11 |
12 | 14 | 15 | 16 |
17 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Terminal/TerminalDisplay.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.ClassLib.Context 2 | @using BlazorStudio.ClassLib.Store.TerminalCase 3 | 4 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 5 | 6 | 9 | 10 |
11 | Terminal Display 12 |
13 | 14 |
16 | 17 |
18 | @for (var i = 0; i < TerminalSessionFacts.WELL_KNOWN_TERMINAL_SESSION_KEYS.Length; i++) 19 | { 20 | var index = i; 21 | var wellKnownTerminalCommandKey = TerminalSessionFacts.WELL_KNOWN_TERMINAL_SESSION_KEYS[index]; 22 | 23 | 24 | 25 | if (i != TerminalSessionFacts.WELL_KNOWN_TERMINAL_SESSION_KEYS.Length - 1) 26 | { 27 | 28 |   29 |   30 |   31 | 32 | } 33 | } 34 |
35 | 36 | 37 |
38 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Terminal/TerminalDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.Store.TerminalCase; 2 | using Fluxor; 3 | using Fluxor.Blazor.Web.Components; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace BlazorStudio.RazorLib.Terminal; 7 | 8 | public partial class TerminalDisplay : FluxorComponent 9 | { 10 | [Inject] 11 | private IState WellKnownTerminalSessionsStateWrap { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/Terminal/TerminalWellKnownTab.razor: -------------------------------------------------------------------------------- 1 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 2 | 3 | @{ 4 | var wellKnownTerminalSession = TerminalSessionsStateSelection.Value; 5 | 6 | if (wellKnownTerminalSession is not null) 7 | { 8 | 10 | @WellKnownTerminalSessionKey.DisplayName 11 | 12 | 14 | Clear 15 | 16 | 17 | 20 | Kill 21 | 22 | 23 |
24 | @if (wellKnownTerminalSession.HasExecutingProcess) 25 | { 26 | 27 | } 28 | else 29 | { 30 | 31 | } 32 |
33 |
34 | } 35 | } 36 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewAbsoluteFilePathDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.TreeView.TreeViewClasses; 2 | using BlazorStudio.ClassLib.ComponentRenderers.Types; 3 | using BlazorStudio.ClassLib.TreeViewImplementations; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 7 | 8 | public partial class TreeViewAbsoluteFilePathDisplay 9 | : ComponentBase, ITreeViewAbsoluteFilePathRendererType 10 | { 11 | [CascadingParameter] 12 | public TreeViewState TreeViewState { get; set; } = null!; 13 | [CascadingParameter(Name="SearchQuery")] 14 | public string SearchQuery { get; set; } = string.Empty; 15 | [CascadingParameter(Name="SearchMatchTuples")] 16 | public List<(TreeViewStateKey treeViewStateKey, TreeViewAbsoluteFilePath treeViewAbsoluteFilePath)>? SearchMatchTuples { get; set; } 17 | 18 | [Parameter, EditorRequired] 19 | public TreeViewAbsoluteFilePath TreeViewAbsoluteFilePath { get; set; } = null!; 20 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectDependenciesDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | Dependencies 4 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectDependenciesDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 4 | 5 | public partial class TreeViewCSharpProjectDependenciesDisplay : ComponentBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectNugetPackageReferencesDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | NuGet Packages 4 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectNugetPackageReferencesDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 4 | 5 | public partial class TreeViewCSharpProjectNugetPackageReferencesDisplay : ComponentBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectToProjectReferenceDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @CSharpProjectToProjectReference.ReferenceProjectAbsoluteFilePath.FilenameWithExtension 4 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectToProjectReferenceDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | using BlazorStudio.ClassLib.DotNet.CSharp; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 6 | 7 | public partial class TreeViewCSharpProjectToProjectReferenceDisplay : 8 | ComponentBase, ITreeViewCSharpProjectToProjectReferenceRendererType 9 | { 10 | [Parameter, EditorRequired] 11 | public CSharpProjectToProjectReference CSharpProjectToProjectReference { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectToProjectReferencesDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | Project References 4 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewCSharpProjectToProjectReferencesDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 4 | 5 | public partial class TreeViewCSharpProjectToProjectReferencesDisplay : ComponentBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewExceptionDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | @(TreeViewException.Item?.Message ?? "null") 3 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewExceptionDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.ComponentRenderers.Types; 2 | using BlazorCommon.RazorLib.WatchWindow.TreeViewClasses; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 6 | 7 | public partial class TreeViewExceptionDisplay 8 | : ComponentBase, ITreeViewExceptionRendererType 9 | { 10 | [Parameter, EditorRequired] 11 | public TreeViewException TreeViewException { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewGitFileDisplay.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.RazorLib.File 2 | 3 | @inherits Fluxor.Blazor.Web.Components.FluxorComponent 4 | 5 | @{ 6 | var gitFile = TreeViewGitFile.Item; 7 | 8 | var cssClass = "bstudio_git-file"; 9 | } 10 | 11 | @if (gitFile is null) 12 | { 13 |
15 | null 16 |
17 | } 18 | else 19 | { 20 |
22 | 23 | @{ 24 | var gitState = GitStateWrap.Value; 25 | 26 | string shortenedParentDirectoryFilePathString = gitFile.AbsoluteFilePath 27 | .GetAbsoluteFilePathString(); 28 | 29 | if (gitFile.AbsoluteFilePath.ParentDirectory is not null && 30 | gitState.GitFolderAbsoluteFilePath?.ParentDirectory is not null) 31 | { 32 | } 33 | } 34 | 35 | 36 | 37 | 38 | @gitFile.AbsoluteFilePath.FilenameWithExtension 39 | 40 | 41 | 42 | @shortenedParentDirectoryFilePathString 43 | 44 |
45 | } 46 | -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewGitFileDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorCommon.RazorLib.TreeView.TreeViewClasses; 2 | using BlazorStudio.ClassLib.ComponentRenderers.Types; 3 | using BlazorStudio.ClassLib.FileSystem.Interfaces; 4 | using BlazorStudio.ClassLib.Store.GitCase; 5 | using BlazorStudio.ClassLib.TreeViewImplementations; 6 | using Fluxor; 7 | using Fluxor.Blazor.Web.Components; 8 | using Microsoft.AspNetCore.Components; 9 | 10 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 11 | 12 | public partial class TreeViewGitFileDisplay 13 | : FluxorComponent, ITreeViewGitFileRendererType 14 | { 15 | [Inject] 16 | private IState GitStateWrap { get; set; } = null!; 17 | 18 | [CascadingParameter] 19 | public TreeViewState TreeViewState { get; set; } = null!; 20 | 21 | [Parameter, EditorRequired] 22 | public TreeViewGitFile TreeViewGitFile { get; set; } = null!; 23 | 24 | private string TryShortenGitFilePath( 25 | IAbsoluteFilePath absoluteFilePath, 26 | IAbsoluteFilePath shortenByStartsWithAbsoluteFilePath) 27 | { 28 | var shortenByStartsWithAbsoluteFilePathString = shortenByStartsWithAbsoluteFilePath.ParentDirectory? 29 | .GetAbsoluteFilePathString() ?? string.Empty; 30 | 31 | var absoluteFilePathString = absoluteFilePath 32 | .GetAbsoluteFilePathString(); 33 | 34 | if (absoluteFilePathString.StartsWith(shortenByStartsWithAbsoluteFilePathString)) 35 | { 36 | return new string (absoluteFilePathString 37 | .Skip(shortenByStartsWithAbsoluteFilePathString.Length) 38 | .ToArray()); 39 | } 40 | 41 | return absoluteFilePathString; 42 | } 43 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewLightWeightNugetPackageRecordDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @LightWeightNugetPackageRecord.Title/@LightWeightNugetPackageRecord.Version 6 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewLightWeightNugetPackageRecordDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | using BlazorStudio.ClassLib.Nuget; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 6 | 7 | public partial class TreeViewLightWeightNugetPackageRecordDisplay : 8 | ComponentBase, ITreeViewLightWeightNugetPackageRecordRendererType 9 | { 10 | [Parameter, EditorRequired] 11 | public LightWeightNugetPackageRecord LightWeightNugetPackageRecord { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewNamespacePathDisplay.razor: -------------------------------------------------------------------------------- 1 | @using BlazorStudio.RazorLib.File 2 | 3 |
4 | 5 | @NamespacePath.AbsoluteFilePath.FilenameWithExtension 6 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewNamespacePathDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | using BlazorStudio.ClassLib.Namespaces; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 6 | 7 | public partial class TreeViewNamespacePathDisplay 8 | : ComponentBase, ITreeViewNamespacePathRendererType 9 | { 10 | [Parameter, EditorRequired] 11 | public NamespacePath NamespacePath { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewSolutionFolderDisplay.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @DotNetSolutionFolder.DisplayName 4 |
-------------------------------------------------------------------------------- /BlazorStudio.RazorLib/TreeViewImplementations/TreeViewSolutionFolderDisplay.razor.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.ComponentRenderers.Types; 2 | using BlazorStudio.ClassLib.DotNet; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace BlazorStudio.RazorLib.TreeViewImplementations; 6 | 7 | public partial class TreeViewSolutionFolderDisplay 8 | : ComponentBase, ITreeViewSolutionFolderRendererType 9 | { 10 | [Parameter, EditorRequired] 11 | public DotNetSolutionFolder DotNetSolutionFolder { get; set; } = null!; 12 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @using BlazorCommon.RazorLib.CustomEvents 3 | @using BlazorCommon.RazorLib.Icons 4 | @using BlazorCommon.RazorLib.Icons.Codicon 5 | @using BlazorStudio.RazorLib.ContextCase 6 | @using BlazorStudio.RazorLib.Button -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/wwwroot/Themes/blazorStudioLightTheme.css: -------------------------------------------------------------------------------- 1 | .bcrl_visual-studio-light-theme-clone { 2 | --bstudio_header-background-color: #cad5eb; 3 | --bstudio_body-background-color: rgb(253, 253, 253); 4 | --bstudio_footer-background-color: #d4d4d4; 5 | --bstudio_input-background-color: rgb(250, 250, 250); 6 | --bstudio_input-font-color: #000000; 7 | --bstudio_section-title-background-color: #c7e9c2; 8 | } -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/wwwroot/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/BlazorStudio.RazorLib/wwwroot/background.png -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/wwwroot/blazorStudio.js: -------------------------------------------------------------------------------- 1 | window.blazorStudio = { 2 | localStorageSetItem: function (key, value) { 3 | localStorage.setItem(key, value); 4 | }, 5 | localStorageGetItem: function (key, value) { 6 | return localStorage.getItem(key); 7 | }, 8 | } 9 | 10 | Blazor.registerCustomEventType('bskeydown', { 11 | browserEventName: 'keydown', 12 | createEventArgs: e => { 13 | if (e.code !== "Tab") { 14 | e.preventDefault(); 15 | } 16 | 17 | return { 18 | "key": e.key, 19 | "code": e.code, 20 | "ctrlWasPressed": e.ctrlKey, 21 | "shiftWasPressed": e.shiftKey, 22 | "altWasPressed": e.altKey 23 | }; 24 | } 25 | }); -------------------------------------------------------------------------------- /BlazorStudio.RazorLib/wwwroot/blazorStudioColors.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --bstudio_header-background-color: #2a2a2e; 3 | --bstudio_body-background-color: #1E1E1E; 4 | --bstudio_footer-background-color: #2b2d2d; 5 | --bstudio_input-background-color: #232d32; 6 | --bstudio_input-font-color: #dcdcdc; 7 | --bstudio_section-title-background-color: #033a00; 8 | } -------------------------------------------------------------------------------- /BlazorStudio.Tests/Basics/FileSystem/DoNothingJsRuntime.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.JSInterop; 2 | 3 | namespace BlazorStudio.Tests.Basics.FileSystem; 4 | 5 | public class DoNothingJsRuntime : IJSRuntime 6 | { 7 | public ValueTask InvokeAsync(string identifier, object?[]? args) 8 | { 9 | return default; 10 | } 11 | 12 | public ValueTask InvokeAsync(string identifier, CancellationToken cancellationToken, object?[]? args) 13 | { 14 | return default; 15 | } 16 | } -------------------------------------------------------------------------------- /BlazorStudio.Tests/Basics/FileSystem/FileSystemEffectTests.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.FileSystem.Classes.FilePath; 2 | using BlazorStudio.ClassLib.Store.FileSystemCase; 3 | 4 | namespace BlazorStudio.Tests.Basics.FileSystem; 5 | 6 | public class FileSystemEffectTests : BlazorStudioFileSystemTestingBase 7 | { 8 | [Fact] 9 | public void SaveFile() 10 | { 11 | var content = "abc123"; 12 | 13 | var absoluteFilePath = new AbsoluteFilePath( 14 | @"C:\Users\hunte\Desktop\TestBlazorStudio\apple.txt", 15 | true, 16 | EnvironmentProvider); 17 | 18 | var saveFileAction = new FileSystemState.SaveFileAction( 19 | absoluteFilePath, 20 | content, 21 | () => {}); 22 | 23 | Dispatcher.Dispatch(saveFileAction); 24 | } 25 | } -------------------------------------------------------------------------------- /BlazorStudio.Tests/Basics/Terminal/DotNetSolutionParserTests.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using CliWrap; 3 | using CliWrap.Buffered; 4 | 5 | namespace BlazorStudio.Tests.Basics.Terminal; 6 | 7 | public class CliWrapTests 8 | { 9 | [Fact] 10 | public async Task DOTNET_NEW_SLN() 11 | { 12 | var standardErrorBuilder = new StringBuilder(); 13 | var standardInputBuilder = new StringBuilder(); 14 | 15 | await Cli.Wrap("dotnet") 16 | .WithArguments(new [] { "new", "sln" }) 17 | .WithWorkingDirectory(@"C:\Users\hunte\Desktop\TestBlazorStudio") 18 | .WithStandardErrorPipe(PipeTarget.ToStringBuilder(standardErrorBuilder)) 19 | .WithStandardOutputPipe(PipeTarget.ToStringBuilder(standardInputBuilder)) 20 | .WithValidation(CommandResultValidation.None) 21 | .ExecuteBufferedAsync(); 22 | } 23 | 24 | [Fact] 25 | public void AdhocTest() 26 | { 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /BlazorStudio.Tests/BlazorStudio.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 1.0.0 8 | 9 | false 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | all 19 | 20 | 21 | runtime; build; native; contentfiles; analyzers; buildtransitive 22 | all 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /BlazorStudio.Tests/UserStories/SemanticParsing/C/USER_STORY_HELLO_WORLD.cs: -------------------------------------------------------------------------------- 1 | using BlazorStudio.ClassLib.CodeAnalysis.C.Syntax; 2 | using BlazorStudio.ClassLib.Parsing.C; 3 | 4 | namespace BlazorStudio.Tests.Basics.SemanticParsing.C; 5 | 6 | /// 7 | /// User Story Description: 8 | /// User wants to type up a hello world program in the C programming language. 9 | /// 10 | public class USER_STORY_HELLO_WORLD 11 | { 12 | [Fact] 13 | public void Enact() 14 | { 15 | string sourceText = @"#include 16 | 17 | int main() { 18 | // printf() displays the string inside quotation 19 | printf(""Hello, World!""); 20 | 21 | return 0; 22 | }".ReplaceLineEndings("\n"); 23 | 24 | var lexer = new LexSession(sourceText); 25 | 26 | lexer.Lex(); 27 | 28 | var parser = new ParserSession( 29 | lexer.SyntaxTokens, 30 | sourceText, 31 | lexer.Diagnostics); 32 | 33 | var compilationUnit = parser.Parse(); 34 | 35 | throw new NotImplementedException("TODO: Perform assertions"); 36 | } 37 | } -------------------------------------------------------------------------------- /BlazorStudio.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "BlazorStudio" repository will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [1.0.0] - 2022-10-11 (Initial Release) 9 | 10 |
11 | Click to show changes 12 | 13 | TODO: Fill out initial release changes 14 |
15 | 16 | --- 17 | 18 | ## [?.?.?] - ????-??-?? (Succinct description) 19 | 20 |
21 | Click to show changes 22 | 23 | TODO: Delete this [?.?.?] version change logging. It is here to illustrate how the CHANGELOG.md file will be structured in the future once more than just one version is available of BlazorStudio. 24 |
-------------------------------------------------------------------------------- /FEATURES.md: -------------------------------------------------------------------------------- 1 | TODO: Fill out FEATURES.md 2 | -------------------------------------------------------------------------------- /Images/RootREADME/blazorTextEditorAnalysisNeedsRef.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/blazorTextEditorAnalysisNeedsRef.gif -------------------------------------------------------------------------------- /Images/RootREADME/cloneBlazorStudio.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/cloneBlazorStudio.gif -------------------------------------------------------------------------------- /Images/RootREADME/cloneBlazorTextEditor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/cloneBlazorTextEditor.gif -------------------------------------------------------------------------------- /Images/RootREADME/cloneBlazorTextEditorAnalysis.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/cloneBlazorTextEditorAnalysis.gif -------------------------------------------------------------------------------- /Images/RootREADME/cloneGif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/cloneGif.gif -------------------------------------------------------------------------------- /Images/RootREADME/cloneGifIntro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/cloneGifIntro.gif -------------------------------------------------------------------------------- /Images/RootREADME/cloneGifUsage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/cloneGifUsage.gif -------------------------------------------------------------------------------- /Images/RootREADME/vscodeWebtools.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/RootREADME/vscodeWebtools.gif -------------------------------------------------------------------------------- /Images/clipart3420085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/clipart3420085.png -------------------------------------------------------------------------------- /Images/contextMenuComponent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/contextMenuComponent.gif -------------------------------------------------------------------------------- /Images/solutionExplorer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/solutionExplorer.gif -------------------------------------------------------------------------------- /Images/startupProject.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/startupProject.gif -------------------------------------------------------------------------------- /Images/textEditor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/textEditor.gif -------------------------------------------------------------------------------- /Images/themes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/themes.gif -------------------------------------------------------------------------------- /Images/windowComponent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Images/windowComponent.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 huntercfreeman 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 | -------------------------------------------------------------------------------- /Photino.Blazor/Photino.Blazor/Photino.Blazor.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Photino.Blazor 5 | $version$ 6 | Photino 7 | TryPhotino 8 | false 9 | Apache-2.0 10 | https://github.com/tryphotino/photino.Blazor 11 | .NET 5 app that opens native OS windows hosting Blazor on Windows, Mac, and Linux 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Photino.Blazor/Photino.Blazor/PhotinoBlazorAppConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Photino.Blazor 4 | { 5 | public class PhotinoBlazorAppConfiguration 6 | { 7 | public Uri AppBaseUri { get; set; } 8 | 9 | public string HostPage { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Photino.Blazor/Photino.Blazor/PhotinoHttpHandler.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Net; 3 | using System.Net.Http; 4 | using System.Net.Http.Headers; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace Photino.Blazor 9 | { 10 | public class PhotinoHttpHandler : DelegatingHandler 11 | { 12 | private readonly PhotinoBlazorApp app; 13 | 14 | //use this constructor if a handler is registered in DI to inject dependencies 15 | public PhotinoHttpHandler(PhotinoBlazorApp app) : this(app, null) 16 | { 17 | } 18 | 19 | //Use this constructor if a handler is created manually. 20 | //Otherwise, use DelegatingHandler.InnerHandler public property to set the next handler. 21 | public PhotinoHttpHandler(PhotinoBlazorApp app, HttpMessageHandler innerHandler) 22 | { 23 | this.app = app; 24 | 25 | //the last (inner) handler in the pipeline should be a "real" handler. 26 | //To make a HTTP request, create a HttpClientHandler instance. 27 | InnerHandler = innerHandler ?? new HttpClientHandler(); 28 | } 29 | 30 | protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 31 | { 32 | Stream content = app.HandleWebRequest(null, null, request.RequestUri.AbsoluteUri, out string contentType); 33 | if(content != null) 34 | { 35 | var response = new HttpResponseMessage(HttpStatusCode.OK); 36 | response.Content = new StreamContent(content); 37 | response.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); 38 | return response; 39 | } 40 | 41 | return await base.SendAsync(request, cancellationToken); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Photino.Blazor/Photino.Blazor/Utils/SynchronousTaskScheduler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace Photino.Blazor.Utils 6 | { 7 | class SynchronousTaskScheduler : TaskScheduler 8 | { 9 | public override int MaximumConcurrencyLevel 10 | { 11 | get { return 1; } 12 | } 13 | 14 | protected override void QueueTask(Task task) 15 | { 16 | TryExecuteTask(task); 17 | } 18 | 19 | protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) 20 | { 21 | return TryExecuteTask(task); 22 | } 23 | 24 | protected override IEnumerable GetScheduledTasks() 25 | { 26 | return Enumerable.Empty(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Photino.Blazor/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Photino.Blazor/favicon.ico -------------------------------------------------------------------------------- /Photino.Blazor/photino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huntercfreeman/BlazorStudio/57acdf4f6c9550ef56f89e5dd801142a755ff6a4/Photino.Blazor/photino.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Development on this project is now done in the https://github.com/Luthetus/Luthetus.Ide repository. 2 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | ## An update every 2 weeks is the goal. 2 | 3 | --- 4 | 5 | ### 1.1.0 (2023-01-27) // The previously stated date: (2023-01-20) 6 | - NOTE: I am mentally fatigued and need to extend this out one week. Instead of the 20th it will be the 27nth. 7 | - NOTE: Most of the progress for this update as of 2023-01-15 has been in the "BlazorStudio" repo of mine and the branch named "dev". See this link: https://github.com/huntercfreeman/BlazorStudio/tree/dev 8 | - git integration 9 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "6.0.0", 4 | "rollForward": "latestMajor", 5 | "allowPrerelease": false 6 | } 7 | } --------------------------------------------------------------------------------