123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Xml;
- using OpenSEMI.ClientBase.ServiceProvider;
- using MECF.Framework.Common.RecipeCenter;
- using MECF.Framework.Common.Equipment;
- using RecipeEditorLib.DGExtension.CustomColumn;
- namespace VirgoUI.Client.Models.Recipe.Sequence
- {
- public class SequenceDataProvider : IProvider
- {
- private static SequenceDataProvider _Instance = null;
- public static SequenceDataProvider Instance
- {
- get
- {
- if (_Instance == null)
- _Instance = new SequenceDataProvider();
- return _Instance;
- }
- }
- public void Create()
- {
- }
- public bool CreateSequenceFolder(string foldername)
- {
- return RecipeClient.Instance.Service.CreateSequenceFolder(foldername);
- }
- public bool DeleteSequenceFolder(string foldername)
- {
- return RecipeClient.Instance.Service.DeleteSequenceFolder(foldername);
- }
- public bool Save(SequenceData seq)
- {
- return RecipeClient.Instance.Service.SaveSequence(seq.Name, seq.ToXml());
- }
- public List<string> GetSequences()
- {
- return RecipeClient.Instance.Service.GetSequenceNameList();
- }
- public List<string> GetRecipes(ModuleName modulename)
- {
- return RecipeClient.Instance.Service.GetRecipes(modulename, true).ToList();
- }
- public SequenceData GetSequenceByName(ObservableCollection<ColumnBase> _columns, string name)
- {
- string content = RecipeClient.Instance.Service.GetSequence(name);
- SequenceData seq = new SequenceData();
- XmlDocument doc = new XmlDocument();
- doc.LoadXml(content);
- seq.Name = name;
- seq.Load(_columns, doc);
- return seq;
- }
- public bool Rename(string beforename, string currentname)
- {
- return RecipeClient.Instance.Service.RenameSequence(beforename, currentname);
- }
- public bool Delete(string name)
- {
- return RecipeClient.Instance.Service.DeleteSequence(name);
- }
- public bool SaveAs(string name, SequenceData seq)
- {
- return RecipeClient.Instance.Service.SaveAsSequence(name, seq.ToXml());
- }
- public string GetSequenceFromXml()
- {
- string template = RecipeClient.Instance.Service.GetSequenceFormatXml();
- return template;
- }
- }
- }
|