Skip to content

Commit

Permalink
Fixed bug renaming components that are in folders
Browse files Browse the repository at this point in the history
General refactoring.
  • Loading branch information
vchelaru committed Jan 25, 2025
1 parent 81956ab commit 3faa305
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 226 deletions.
2 changes: 1 addition & 1 deletion CodeOutputPlugin/CodeOutputPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<Compile Include="Manager\CustomCodeGenerator.cs" />
<Compile Include="Manager\CustomVariableManager.cs" />
<Compile Include="Manager\ParentSetLogic.cs" />
<Compile Include="Manager\RenameManager.cs" />
<Compile Include="Manager\RenameService.cs" />
<Compile Include="Manager\VariableExclusionLogic.cs" />
<Compile Include="Models\CodeOutputElementSettings.cs" />
<Compile Include="Models\CodeOutputProjectSettings.cs" />
Expand Down
7 changes: 5 additions & 2 deletions CodeOutputPlugin/MainCodeOutputPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class MainCodeOutputPlugin : PluginBase
private readonly CodeGenerationFileLocationsService _codeGenerationFileLocationsService;
private readonly CodeGenerationService _codeGenerationService;
private readonly ISelectedState _selectedState;
private readonly RenameService _renameService;
PluginTab pluginTab;

#endregion
Expand All @@ -47,6 +48,8 @@ public MainCodeOutputPlugin()
_codeGenerationService = new CodeGenerationService();

_selectedState = SelectedState.Self;

_renameService = new RenameService();
}

public override void StartUp()
Expand All @@ -64,7 +67,7 @@ private void AssignEvents()
this.InstanceReordered += HandleInstanceReordered;

this.ElementSelected += HandleElementSelected;
this.ElementRename += (element, oldName) => RenameManager.HandleRename(element, oldName, codeOutputProjectSettings);
this.ElementRename += (element, oldName) => _renameService.HandleRename(element, oldName, codeOutputProjectSettings);
this.ElementAdd += HandleElementAdd;
this.ElementDelete += HandleElementDeleted;

Expand Down Expand Up @@ -185,7 +188,7 @@ private void HandleVariableSet(ElementSave element, InstanceSave instance, strin
{
ParentSetLogic.HandleVariableSet(element, instance, variableName, oldValue, codeOutputProjectSettings);

RenameManager.HandleVariableSet(element, instance, variableName, oldValue, codeOutputProjectSettings);
_renameService.HandleVariableSet(element, instance, variableName, oldValue, codeOutputProjectSettings);

HandleRefreshAndExport();
}
Expand Down
184 changes: 0 additions & 184 deletions CodeOutputPlugin/Manager/RenameManager.cs

This file was deleted.

Loading

0 comments on commit 3faa305

Please sign in to comment.