예제 #1
0
 private IResource ConvertWpfResourcekToModel(ResourceWPF resourceWPF)
 {
     if (resourceWPF == null)
     {
         throw new ArgumentNullException();
     }
     return((resourceWPF as ResourceWPF).ResourceModel);
 }
예제 #2
0
 public static SaveResource ToSave(ResourceWPF resource)
 {
     return(new SaveResource()
     {
         Id = Guid.NewGuid(),
         Position = resource.Position,
         Model = resource.ResourceModel
     });
 }
예제 #3
0
        // Загрузка связи с ресурсами
        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);
        }
예제 #4
0
 // Загрузка блока ресурсов
 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);
     }
 }