From c62839f6c403c4ce02d1de4c8f84c8765ff18d71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Thu, 21 Jul 2022 18:52:14 +0200 Subject: [PATCH] wip --- CrowEdit.csproj | 2 +- CrowEditBase/src/Plugin.cs | 2 +- CrowEditBase/ui/CrowEdit.style | 3 ++ plugins/CECrowPlugin/CECrowPlugin.csproj | 2 +- plugins/CECrowPlugin/src/CrowService.cs | 38 +++++++++---------- plugins/CECrowPlugin/ui/EnumSelector.template | 2 +- plugins/CECrowPlugin/ui/winConfiguration.crow | 21 ++++++---- .../CENetcoreDbgPlugin.csproj | 3 +- plugins/CENetcoreDbgPlugin/default.conf | 1 + .../src/NetcoreDbgService.cs | 7 ++-- .../ui/winConfiguration.crow | 2 +- plugins/CERoslynPlugin/src/RoslynService.cs | 19 +++++++++- plugins/CERoslynPlugin/src/SolutionProject.cs | 4 +- 13 files changed, 62 insertions(+), 44 deletions(-) create mode 100644 plugins/CENetcoreDbgPlugin/default.conf diff --git a/CrowEdit.csproj b/CrowEdit.csproj index 0bae253..4132a1d 100644 --- a/CrowEdit.csproj +++ b/CrowEdit.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5 WinExe false diff --git a/CrowEditBase/src/Plugin.cs b/CrowEditBase/src/Plugin.cs index 55950bd..aa67fc3 100644 --- a/CrowEditBase/src/Plugin.cs +++ b/CrowEditBase/src/Plugin.cs @@ -72,7 +72,7 @@ namespace CrowEditBase string mainService = config.Get ("MainService"); if (!string.IsNullOrEmpty (mainService)) { serviceClass = loadContext.MainAssembly.GetType (mainService); - App.GetService (serviceClass)?.Start(); + App.GetService (serviceClass);//instantiate service without starting it } string fileAssociations = config.Get ("FileAssociations"); if (!string.IsNullOrEmpty (fileAssociations)) { diff --git a/CrowEditBase/ui/CrowEdit.style b/CrowEditBase/ui/CrowEdit.style index 17c4d56..e94bbc0 100644 --- a/CrowEditBase/ui/CrowEdit.style +++ b/CrowEditBase/ui/CrowEdit.style @@ -140,4 +140,7 @@ CheckBox { Unchecked = "{Background=${ControlIdle}}"; MouseEnter = "{Foreground=${ControlCaptionHoverColor}}"; MouseLeave = "{Foreground=${ControlForeground}}"; +} +LogViewerWidget { + Background = "0.01,0.01,0.01,1"; } \ No newline at end of file diff --git a/plugins/CECrowPlugin/CECrowPlugin.csproj b/plugins/CECrowPlugin/CECrowPlugin.csproj index 1a634b7..67b653f 100644 --- a/plugins/CECrowPlugin/CECrowPlugin.csproj +++ b/plugins/CECrowPlugin/CECrowPlugin.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net5 false diff --git a/plugins/CECrowPlugin/src/CrowService.cs b/plugins/CECrowPlugin/src/CrowService.cs index 62b2753..b944528 100644 --- a/plugins/CECrowPlugin/src/CrowService.cs +++ b/plugins/CECrowPlugin/src/CrowService.cs @@ -138,11 +138,12 @@ namespace Crow Action delSetZoomFactor; - FieldInfo fiDbg_IncludeEvents, fiDbg_DiscardEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount, fiDbgIFace_Terminate; + FieldInfo fiDbg_IncludedEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount, fiDbgIFace_Terminate; #endregion bool recording, debugLogIsEnabled; - DbgEvtType recordedEvents = DbgEvtType.Widget, discardedEvents; + IList recordedEvents = new ObservableList(new DbgEvtType[] {DbgEvtType.Widget} ); + DbgEvtType addRecordedEvents = DbgEvtType.None; public bool HasVkvgBackend { get; private set; } public int RefreshRate { get => Configuration.Global.Get ("RefreshRate", 10); @@ -202,41 +203,37 @@ namespace Crow return; recording = IsRunning & DebugLogIsEnabled & value; if (recording) { - fiDbg_DiscardEvents.SetValue (dbgIFace, DiscardedEvents); - fiDbg_IncludeEvents.SetValue (dbgIFace, RecordedEvents); + fiDbg_IncludedEvents.SetValue (dbgIFace, RecordedEvents.ToList()); CMDStartRecording.CanExecute = false; CMDStopRecording.CanExecute = true; } else { - fiDbg_DiscardEvents.SetValue (dbgIFace, DbgEvtType.All); - fiDbg_IncludeEvents.SetValue (dbgIFace, DbgEvtType.None); + fiDbg_IncludedEvents.SetValue (dbgIFace, new List()); CMDStartRecording.CanExecute = debugLogIsEnabled; CMDStopRecording.CanExecute = false; } NotifyValueChanged(recording); } } - public DbgEvtType RecordedEvents { + public IList RecordedEvents { get => recordedEvents; set { if (recordedEvents == value) return; recordedEvents = value; if (Recording) - fiDbg_IncludeEvents.SetValue (dbgIFace, value); + fiDbg_IncludedEvents.SetValue (dbgIFace, value); NotifyValueChanged (recordedEvents); } } - public DbgEvtType DiscardedEvents { - get => discardedEvents; + public DbgEvtType AddRecordedEvents { + get => addRecordedEvents; set { - if (discardedEvents == value) + if (addRecordedEvents == value) return; - discardedEvents = value; - if (Recording) - fiDbg_DiscardEvents.SetValue (dbgIFace, value); - NotifyValueChanged (discardedEvents); + addRecordedEvents = value; + NotifyValueChanged (addRecordedEvents); } - } + } public string DebugLogFilePath { get => Configuration.Global.Get ("DebugLogFilePath"); set { @@ -361,8 +358,7 @@ namespace Crow fiDbgIFace_MaxLayoutingTries = dbgIfaceType.GetField("MaxLayoutingTries", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy); fiDbgIFace_MaxDiscardCount = dbgIfaceType.GetField("MaxDiscardCount", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy); - fiDbg_IncludeEvents = debuggerType.GetField("IncludeEvents"); - fiDbg_DiscardEvents = debuggerType.GetField("DiscardEvents"); + fiDbg_IncludedEvents = debuggerType.GetField("IncludedEvents"); fiDbg_ConsoleOutput = debuggerType.GetField("ConsoleOutput"); delResetDebugger = (Action)Delegate.CreateDelegate(typeof(Action), null, debuggerType.GetMethod("Reset")); /*delSaveDebugLog = (Action)Delegate.CreateDelegate(typeof(Action), @@ -447,14 +443,13 @@ namespace Crow crowAssemblies.Add (a); } - - protected override void onStateChange(Status previousState, Status newState) { base.onStateChange(previousState, newState); CMDRefresh.CanExecute = IsRunning; } - #region Mouse & Keyboard + + #region Mouse & Keyboard Point mouseScreenPos;//absolute on screen position. public void onKeyDown(KeyEventArgs e) { @@ -549,6 +544,7 @@ namespace Crow } } #endregion + public ISurface MainSurface => IsRunning ? delGetMainSurface() : null; public void Resize (int width, int height) { if (IsRunning) diff --git a/plugins/CECrowPlugin/ui/EnumSelector.template b/plugins/CECrowPlugin/ui/EnumSelector.template index 9b8cdfa..b0a9f25 100644 --- a/plugins/CECrowPlugin/ui/EnumSelector.template +++ b/plugins/CECrowPlugin/ui/EnumSelector.template @@ -6,5 +6,5 @@