Преглед изворни кода

Rename部分情况下 会失败

jiangjy пре 4 дана
родитељ
комит
59e45531ef

+ 2 - 2
Furnace/FurnaceUI/Views/Recipes/RecipeJobViewModel.cs

@@ -1344,8 +1344,8 @@ namespace FurnaceUI.Views.Recipes
                 DialogBox.ShowWarning($"Can not create folder {newName}, Folder name too long, should be less 200.");
                 return;
             }
-            prefix = GetPrefix(prefix, CurrentFileNode);
-            if (_recipeProvider.RenameRecipe(prefix, CurrentFileNode.Name, recipeName))
+            prefix = dialog.FilePath;
+            if (_recipeProvider.RenameRecipe(dialog.FilePath, CurrentFileNode.Name, recipeName))
             {
                 UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Rename Recipe from [{CurrentFileNode.FullPath}] to [{recipeName}] {DateTime.Now}";
             }

+ 2 - 2
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutViewModel.cs

@@ -1355,8 +1355,8 @@ namespace FurnaceUI.Views.Recipes
                 DialogBox.ShowWarning($"Can not create folder {newName}, Folder name too long, should be less 200.");
                 return;
             }
-            prefix = GetPrefix(prefix, CurrentFileNode);
-            if (_recipeProvider.RenameRecipe(prefix, CurrentFileNode.Name, recipeName))
+            prefix = dialog.FilePath;
+            if (_recipeProvider.RenameRecipe(dialog.FilePath, CurrentFileNode.Name, recipeName))
             {
                 UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Rename Recipe from [{CurrentFileNode.FullPath}] to [{recipeName}] {DateTime.Now}";
             }

+ 3 - 3
Furnace/FurnaceUI/Views/Recipes/RecipeViewModel.cs

@@ -1417,15 +1417,15 @@ namespace FurnaceUI.Views.Recipes
                 DialogBox.ShowWarning($"Can not create folder {newName}, Folder name too long, should be less 200.");
                 return;
             }
-            prefix = GetPrefix(prefix, CurrentFileNode);
-            if (_recipeProvider.RenameRecipe(prefix, CurrentFileNode.Name, recipeName))
+            prefix = dialog.FilePath;
+            if (_recipeProvider.RenameRecipe(dialog.FilePath, CurrentFileNode.Name, recipeName))
             {
                 UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Rename Recipe from [{CurrentFileNode.FullPath}] to [{recipeName}] {DateTime.Now}";
             }
             CurrentRecipe.Name = newName;
             CurrentRecipe.Description = dialog.Comment;
             CurrentRecipe.ReviseTime = DateTime.Now;
-            CurrentRecipe.PrefixPath = CurrentChamberType + "\\" + CurrentProcessType;
+            CurrentRecipe.PrefixPath = CurrentChamberType + "\\" + CurrentProcessType; ;
             //ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newName, false);
             ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
             item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;