|  | @@ -1,4 +1,5 @@
 | 
	
		
			
				|  |  |  using Aitex.Core.RT.Log;
 | 
	
		
			
				|  |  | +using Aitex.Sorter.Common;
 | 
	
		
			
				|  |  |  using Caliburn.Micro;
 | 
	
		
			
				|  |  |  using Caliburn.Micro.Core;
 | 
	
		
			
				|  |  |  using FurnaceUI.Common;
 | 
	
	
		
			
				|  | @@ -14,6 +15,8 @@ using MECF.Framework.UI.Client.ClientBase;
 | 
	
		
			
				|  |  |  using OpenSEMI.ClientBase;
 | 
	
		
			
				|  |  |  using OpenSEMI.ClientBase.Command;
 | 
	
		
			
				|  |  |  using RecipeEditorLib.RecipeModel.Params;
 | 
	
		
			
				|  |  | +using SciChart.Charting.Common.Extensions;
 | 
	
		
			
				|  |  | +using SciChart.Core.Extensions;
 | 
	
		
			
				|  |  |  using System;
 | 
	
		
			
				|  |  |  using System.Collections.Generic;
 | 
	
		
			
				|  |  |  using System.Collections.ObjectModel;
 | 
	
	
		
			
				|  | @@ -210,8 +213,20 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                  return this._historyRecipeCommand;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        private List<FileNode> _recipeFileList = new List<FileNode>();
 | 
	
		
			
				|  |  | +        public List<FileNode> RecipeFileList
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            get { return _recipeFileList; }
 | 
	
		
			
				|  |  | +            set { _recipeFileList = value; this.NotifyOfPropertyChange(nameof(RecipeFileList)); }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private List<ProcessTypeFileItem> _processTypeFileList = new List<ProcessTypeFileItem>();
 | 
	
		
			
				|  |  | +        public List<ProcessTypeFileItem> ProcessTypeFileList
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            get { return _processTypeFileList; }
 | 
	
		
			
				|  |  | +            set { _processTypeFileList = value; this.NotifyOfPropertyChange(nameof(ProcessTypeFileList)); }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        public ObservableCollection<ProcessTypeFileItem> ProcessTypeFileList { get; set; } = new ObservableCollection<ProcessTypeFileItem>();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          public RecipeDataBase CurrentRecipe { get; private set; }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -411,6 +426,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                  // var recipes = _recipeProvider.GetXmlRecipeList(prefix);
 | 
	
		
			
				|  |  |                  type.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList(prefix);// RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files;
 | 
	
		
			
				|  |  |                  ProcessTypeFileList.Add(type);
 | 
	
		
			
				|  |  | +                RecipeFileList = type.FileListByProcessType.FirstOrDefault()?.Files.ToList();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //if (ProcessTypeFileList[0].FileListByProcessType.Count > 0)
 | 
	
		
			
				|  |  |              //    CurrentFileNode = ProcessTypeFileList[0].FileListByProcessType[ProcessTypeFileList[0].FileListByProcessType.Count - 1];
 | 
	
	
		
			
				|  | @@ -456,7 +472,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              string recipeName = fileName.Trim();
 | 
	
		
			
				|  |  |              string description = "";
 | 
	
		
			
				|  |  | -            string prefix = CurrentChamberType + "\\" + CurrentProcessType;
 | 
	
		
			
				|  |  | +            string prefix = CurrentChamberType + "\\" + CurrentProcessType + "\\" + fileName;
 | 
	
		
			
				|  |  |              if (!IsExist(recipeName.ToLower(), true))
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  RecipeDataBase recipe = new RecipeDataBase();
 | 
	
	
		
			
				|  | @@ -545,6 +561,21 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      //  this.Save(this.CurrentRecipe, false);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            if (node != null && !node.IsFile)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                ProcessTypeFileList[0].FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = false;
 | 
	
		
			
				|  |  | +                    if (a.Name == node.Name)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        a.IsSelected = true;
 | 
	
		
			
				|  |  | +                        RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                        return;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              CurrentFileNode = node;
 | 
	
		
			
				|  |  |              IsFreePermission = true;
 | 
	
		
			
				|  |  |              IsReadAndWritePermission = true;
 | 
	
	
		
			
				|  | @@ -591,7 +622,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      processType = selectRecipeType;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                ProcessTypeFileList = new ObservableCollection<ProcessTypeFileItem>();
 | 
	
		
			
				|  |  | +                ProcessTypeFileList = new List<ProcessTypeFileItem>();
 | 
	
		
			
				|  |  |                  string[] recipeProcessType = ((string)processType).Split(',');
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  for (int i = 0; i < recipeProcessType.Length; i++)
 | 
	
	
		
			
				|  | @@ -656,7 +687,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      prefix = selectNode.PrefixPath;
 | 
	
		
			
				|  |  |                      folder = selectNode.FullPath.Replace($"{prefix}\\", "");
 | 
	
		
			
				|  |  | -                    newFolder = $"{folder}\\{ name}";
 | 
	
		
			
				|  |  | +                    newFolder = $"{folder}\\{name}";
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  else
 | 
	
		
			
				|  |  |                  {
 | 
	
	
		
			
				|  | @@ -676,7 +707,19 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                  prefix = GetPrefix(prefix, selectNode);
 | 
	
		
			
				|  |  |                  _recipeProvider.CreateRecipeFolder(prefix, name);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newFolder, true);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
 | 
	
		
			
				|  |  | +                if (item == null)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    LOG.Write("error reload recipe file list, type = " + CurrentProcessType);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                //var recipes = _recipeProvider.GetXmlRecipeList(prefix);
 | 
	
		
			
				|  |  | +                item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
 | 
	
		
			
				|  |  | +                FindSelectedFile(item.FileListByProcessType, $"{prefix}\\{newFolder}");
 | 
	
		
			
				|  |  | +                item.InvokePropertyChanged();
 | 
	
		
			
				|  |  | +                TreeSelectChanged(CurrentFileNode);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          private string GetPrefix(string prefix, FileNode CurrentFileNode)
 | 
	
	
		
			
				|  | @@ -807,7 +850,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              prefix = prefix.Replace($"\\{CurrentFileNode.Name}", "");
 | 
	
		
			
				|  |  |              _recipeProvider.DeleteRecipeFolder(prefix, CurrentFileNode.Name);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false);
 | 
	
		
			
				|  |  | +            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false, true);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          public void RenameFolder()
 | 
	
	
		
			
				|  | @@ -853,7 +896,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      UIGlobalVariable.Instance.ProcessModifiedRecipe[node.FullPath] = $"Folder Rename from [{CurrentFileNode.FullPath}] to [{name}] {DateTime.Now}";
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newFolder, true);
 | 
	
		
			
				|  |  | +            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, name, true, true);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #endregion
 | 
	
	
		
			
				|  | @@ -877,6 +920,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType, "");
 | 
	
		
			
				|  |  | +            dialog.SelectIndex = ProcessTypeFileList[0].FileListByProcessType.IndexOf(ProcessTypeFileList[0].FileListByProcessType.FirstOrDefault(a => a.IsSelected));
 | 
	
		
			
				|  |  |              //dialog.FileName = (string)QueryDataClient.Instance.Service.GetConfig($"System.Recipe.DefaultProcessRecipeName");
 | 
	
		
			
				|  |  |              WindowManager wm = new WindowManager();
 | 
	
		
			
				|  |  |              bool? dialogReturn = wm.ShowDialog(dialog);
 | 
	
	
		
			
				|  | @@ -906,14 +950,14 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      prefix = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            if (IsExist(recipeName.ToLower(), true))
 | 
	
		
			
				|  |  | +            if (RecipeFileList.Find(a => a.Name == recipeName.ToLower()) != null)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  DialogBox.ShowWarning($"Can not create {recipeName}, Recipe with the same name already exist.");
 | 
	
		
			
				|  |  |                  return;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              if ((prefix + recipeName).Length > 200)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  DialogBox.ShowWarning($"Can not create folder {recipeName}, Folder name too long, should be less 200.");
 | 
	
	
		
			
				|  | @@ -954,15 +998,29 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              string newfile = string.Empty;
 | 
	
		
			
				|  |  |              if (types.Length > 2)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                newfile = $"{ string.Join("\\", types.Skip(2))}\\{recipeName}";
 | 
	
		
			
				|  |  | +                newfile = $"{string.Join("\\", types.Skip(2))}\\{recipeName}";
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  newfile = recipeName;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(types[0], types[1], newfile, false);
 | 
	
		
			
				|  |  | +            //ReloadRecipeFileList(types[0], types[1], newfile, false);
 | 
	
		
			
				|  |  | +            ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == types[1]);
 | 
	
		
			
				|  |  | +            item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
 | 
	
		
			
				|  |  | +            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{newfile}");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            item.FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                a.IsSelected = false;
 | 
	
		
			
				|  |  | +                if (a.FullPath == prefix)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = true;
 | 
	
		
			
				|  |  | +                    CurrentFileNode = a;
 | 
	
		
			
				|  |  | +                    RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          public void NewRecipeRoot()
 | 
	
	
		
			
				|  | @@ -1027,7 +1085,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, recipeName, false);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void ReloadRecipeFileList(string chamberType, string processType, string selectedFile, bool selectionIsFolder)
 | 
	
		
			
				|  |  | +        private void ReloadRecipeFileList(string chamberType, string processType, string selectedFile, bool selectionIsFolder, bool isRefreshFlod = false)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == processType);
 | 
	
		
			
				|  |  |              if (item == null)
 | 
	
	
		
			
				|  | @@ -1039,8 +1097,10 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              //var recipes = _recipeProvider.GetXmlRecipeList(prefix);
 | 
	
		
			
				|  |  |              item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList(prefix);// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
 | 
	
		
			
				|  |  |              FindSelectedFile(item.FileListByProcessType, $"{prefix}\\{selectedFile}");
 | 
	
		
			
				|  |  | +            if (isRefreshFlod)
 | 
	
		
			
				|  |  | +                item.InvokePropertyChanged();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            item.InvokePropertyChanged();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private bool FindSelectedFile(ObservableCollection<FileNode> nodes, string selectedFile)
 | 
	
	
		
			
				|  | @@ -1053,6 +1113,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      if (recipe.FullPath == selectedFile && recipe.Files.Count == 0)
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          recipe.IsSelected = true;
 | 
	
		
			
				|  |  | +                        CurrentFileNode = recipe;
 | 
	
		
			
				|  |  |                          return true;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      else
 | 
	
	
		
			
				|  | @@ -1074,6 +1135,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      if (filepath == selectedFile.Replace($"{recipe.PrefixPath}\\", ""))
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          recipe.IsSelected = true;
 | 
	
		
			
				|  |  | +                        CurrentFileNode = recipe;
 | 
	
		
			
				|  |  |                          return true;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -1147,8 +1209,8 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |                      this.Save(this.CurrentRecipe, false);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            this.LoadData(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath);
 | 
	
		
			
				|  |  | -            InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType);
 | 
	
		
			
				|  |  | +            InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType, CurrentRecipe.Description, Visibility.Hidden);
 | 
	
		
			
				|  |  | +            dialog.SelectIndex = ProcessTypeFileList[0].FileListByProcessType.IndexOf(ProcessTypeFileList[0].FileListByProcessType.FirstOrDefault(a => a.IsSelected));
 | 
	
		
			
				|  |  |              dialog.FileName = CurrentFileNode.Name;
 | 
	
		
			
				|  |  |              WindowManager wm = new WindowManager();
 | 
	
		
			
				|  |  |              bool? dialogReturn = wm.ShowDialog(dialog);
 | 
	
	
		
			
				|  | @@ -1200,7 +1262,30 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              _recipeProvider.SaveAsRecipe(prefix, recipeName, CurrentRecipe.GetXmlString());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, recipeName, false);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            prefix = GetPrefix(prefix, CurrentFileNode);
 | 
	
		
			
				|  |  | +            if (selectNode.Name == prefix)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, recipeName, false);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
 | 
	
		
			
				|  |  | +                item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
 | 
	
		
			
				|  |  | +                FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{recipeName}");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                item.FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = false;
 | 
	
		
			
				|  |  | +                    if (a.FullPath == prefix)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        a.IsSelected = true;
 | 
	
		
			
				|  |  | +                        RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                        return;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1224,6 +1309,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              InputFileNameDialogViewModel dialog = new InputFileNameDialogViewModel("Input New Recipe Name", ProcessTypeFileList[0].FileListByProcessType, CurrentRecipe.Description, Visibility.Hidden);
 | 
	
		
			
				|  |  | +            dialog.SelectIndex = ProcessTypeFileList[0].FileListByProcessType.IndexOf(ProcessTypeFileList[0].FileListByProcessType.FirstOrDefault(a => a.IsSelected));
 | 
	
		
			
				|  |  |              dialog.FileName = CurrentFileNode.Name;
 | 
	
		
			
				|  |  |              WindowManager wm = new WindowManager();
 | 
	
		
			
				|  |  |              bool? dialogReturn = wm.ShowDialog(dialog);
 | 
	
	
		
			
				|  | @@ -1268,8 +1354,24 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              CurrentRecipe.Name = dialog.FileName;
 | 
	
		
			
				|  |  |              CurrentRecipe.Description = dialog.Comment;
 | 
	
		
			
				|  |  | -            // this.Save(CurrentRecipe, false);
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, newName, false);
 | 
	
		
			
				|  |  | +            CurrentRecipe.ReviseTime= DateTime.Now;
 | 
	
		
			
				|  |  | +            CurrentRecipe.PrefixPath= prefix;
 | 
	
		
			
				|  |  | +          this.Save(CurrentRecipe, false);
 | 
	
		
			
				|  |  | +            //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;
 | 
	
		
			
				|  |  | +            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{newName}");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            item.FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                a.IsSelected = false;
 | 
	
		
			
				|  |  | +                if (a.FullPath == prefix)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = true;
 | 
	
		
			
				|  |  | +                    RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1309,7 +1411,22 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Delet Recipe from [{CurrentFileNode.FullPath}] {DateTime.Now}";
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false);
 | 
	
		
			
				|  |  | +            //ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", 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;
 | 
	
		
			
				|  |  | +            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{""}");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            item.FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                a.IsSelected = false;
 | 
	
		
			
				|  |  | +                if (a.FullPath == prefixPath)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = true;
 | 
	
		
			
				|  |  | +                    RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          public void ReloadRecipe()
 | 
	
	
		
			
				|  | @@ -1377,8 +1494,24 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  UIGlobalVariable.Instance.ProcessModifiedRecipe[CurrentFileNode.FullPath] = $"Edit {DateTime.Now}";
 | 
	
		
			
				|  |  |                  this.editMode = EditMode.Normal;
 | 
	
		
			
				|  |  | -                ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, CurrentFileNode.FullPath, false);
 | 
	
		
			
				|  |  | +                var prefixPath = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
 | 
	
		
			
				|  |  | +                ProcessTypeFileItem item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == CurrentProcessType);
 | 
	
		
			
				|  |  | +                item.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList($"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}");// RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
 | 
	
		
			
				|  |  | +                FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{CurrentFileNode.FullPath}");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                item.FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = false;
 | 
	
		
			
				|  |  | +                    if (a.FullPath == prefixPath)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        a.IsSelected = true;
 | 
	
		
			
				|  |  | +                        CurrentFileNode = a;
 | 
	
		
			
				|  |  | +                        RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                        return;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                });
 | 
	
		
			
				|  |  |                  this.UpdateView();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          public void ViewRecipe()
 | 
	
	
		
			
				|  | @@ -1888,7 +2021,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |          public void SavePermission()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              CurrentRecipe.Clear();
 | 
	
		
			
				|  |  | -            var prefixPath = GetPrefix(CurrentRecipe.PrefixPath, CurrentFileNode);
 | 
	
		
			
				|  |  | +            var prefixPath = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
 | 
	
		
			
				|  |  |              var recipeContent = _recipeProvider.LoadRecipe(prefixPath, CurrentRecipe.Name);
 | 
	
		
			
				|  |  |              if (string.IsNullOrEmpty(recipeContent))
 | 
	
		
			
				|  |  |              {
 | 
	
	
		
			
				|  | @@ -1907,7 +2040,22 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              CurrentRecipe.Description = dialog.RecipeComment;
 | 
	
		
			
				|  |  |              CurrentRecipe.RecipeLevel = CurrentFileNode.Level;
 | 
	
		
			
				|  |  |              this.Save(CurrentRecipe, false);
 | 
	
		
			
				|  |  | -            ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, CurrentFileNode.FullPath, false);
 | 
	
		
			
				|  |  | +            //ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, CurrentFileNode.FullPath, 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;
 | 
	
		
			
				|  |  | +            FindSelectedFile(item.FileListByProcessType, $"{$"{ChamberType[ChamberTypeIndexSelection]}\\{item.ProcessType}"}\\{CurrentFileNode.FullPath}");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            item.FileListByProcessType.ForEachDo(a =>
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                a.IsSelected = false;
 | 
	
		
			
				|  |  | +                if (a.FullPath == CurrentRecipe.PrefixPath)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    a.IsSelected = true;
 | 
	
		
			
				|  |  | +                    RecipeFileList = a.Files.ToList();
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          public bool Save(RecipeDataBase recipe, bool createNew)
 | 
	
	
		
			
				|  | @@ -2009,7 +2157,7 @@ namespace FurnaceUI.Views.Recipes
 | 
	
		
			
				|  |  |              if (CurrentFileNode == null || !CurrentFileNode.IsFile)
 | 
	
		
			
				|  |  |                  return false;
 | 
	
		
			
				|  |  |              var windowManager = IoC.Get<IWindowManager>();
 | 
	
		
			
				|  |  | -            RecipeProcessEditViewModel recipeEditViewModel = new RecipeProcessEditViewModel(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath, CurrentFileNode.Permission);
 | 
	
		
			
				|  |  | +            RecipeProcessEditViewModel recipeEditViewModel = new RecipeProcessEditViewModel(CurrentFileNode.PrefixPath, CurrentFileNode.FullPath, CurrentFileNode.Permission);
 | 
	
		
			
				|  |  |              recipeEditViewModel.SetParent(Window.GetWindow((UIElement)GetView()));
 | 
	
		
			
				|  |  |              recipeEditViewModel.RecipeType = CurrentProcessType;
 | 
	
		
			
				|  |  |              this.CurrentRecipe = recipeEditViewModel.CurrentRecipe;
 |