private IResource ConvertWpfResourcekToModel(ResourceWPF resourceWPF) { if (resourceWPF == null) { throw new ArgumentNullException(); } return((resourceWPF as ResourceWPF).ResourceModel); }
public static SaveResource ToSave(ResourceWPF resource) { return(new SaveResource() { Id = Guid.NewGuid(), Position = resource.Position, Model = resource.ResourceModel }); }
// Загрузка связи с ресурсами private ResConnectionWPF LoadResConnection(SaveResourceConnection connectres, Dictionary <Guid, ProcedureWPF> worksavelistproc, Dictionary <Guid, ResourceWPF> worksavelistres) { ProcedureWPF proc = worksavelistproc[connectres.StartID]; ResourceWPF res = worksavelistres[connectres.EndID]; ResConnectionWPF connection = new ResConnectionWPF(proc, res); proc.AddResPutConnection(connection); res.AddResPutConnection(connection); return(connection); }
// Загрузка блока ресурсов private ResourceWPF LoadResourceBlock(SaveResource Block, Dictionary <Guid, ResourceWPF> worksavelist) { if (worksavelist.ContainsKey(Block.Id)) { return(worksavelist[Block.Id]); } else { ResourceWPF curRes = SaveResource.ToNormal(Block); worksavelist.Add(Block.Id, curRes); return(curRes); } }