Exemple #1
0
 public PlanVersion(PlanVersionSnapshot snapshot)
 {
     _version       = new VersionData(snapshot.Version);
     _simulations   = snapshot.Simulations.Select(x => new Simulation(x)).ToList();
     _name          = snapshot.Name;
     _actions       = snapshot.Actions;
     _resourceTypes = snapshot.ResourceTypes;
     _depot         = snapshot.Depot;
     _readonly      = new ReadonlyMixin(true);
 }
Exemple #2
0
        public PlanVersionSnapshot CreateSnapshot()
        {
            var memento = new PlanVersionSnapshot
            {
                Actions       = Actions.ToList(),
                Depot         = Depot,
                Name          = Name,
                ResourceTypes = ResourceTypes.ToList(),
                Version       = new VersionDataSnapshot(Version),
                Simulations   = Simulations.Select(x => x.CreateSnapshot()).ToList()
            };

            return(memento);
        }
Exemple #3
0
 private PlanVersion(PlanVersionSnapshot snapshot, UserReference user) : this(snapshot)
 {
     _version  = _version.Increment(user);
     _readonly = new ReadonlyMixin(false);
 }