public void Split(Point p) { NodCanvasViewModel ncvm = LinjeRepository.MainRepository.NodCanvasRepository.AddNewCanvasNod(p); LinjeRepository.AddNewLinje(LinjeModel.Nod1, ncvm.NodCanvasModel); LinjeRepository.AddNewLinje(LinjeModel.Nod2, ncvm.NodCanvasModel); ncvm.Select(); JustDelete(); }
public static NodCanvasViewModel CopyNodKlassToNew(NodKlassModel nkm, NodCanvasRepository ncr) { NodCanvasModel newNcm = NodCanvasModel.CopyNod(nkm); NodCanvasViewModel newNcvm = new NodCanvasViewModel() { NodCanvasRepository = ncr, NodCanvasModel = newNcm }; return(newNcvm); }
public void EatNod(NodCanvasViewModel ncvm) { Set(); foreach (LinjeModel l in ncvm.NodCanvasModel.LinjeListModel) { l.ReplaceNod(ncvm.NodCanvasModel, this.NodKlassModel); NodKlassModel.LinjeListModel.Add(l); } ncvm.Delete(); }
public void LooseLinje(Point p) { if (IsSet()) { NodCanvasViewModel ncvm = KlassViewModel.KlassRepository.MainRepository.NodCanvasRepository.AddNewCanvasNod(p); foreach (LinjeModel l in NodKlassModel.LinjeListModel) { l.ReplaceNod(NodKlassModel, ncvm.NodCanvasModel); ncvm.NodCanvasModel.LinjeListModel.Add(l); } ncvm.Select(); UnSet(); } }
public void EatNod(NodCanvasViewModel ncvm) { if (ncvm.HasLines()) { LinjeModel share = LinjeModel.GetSharingLinje(this.NodCanvasModel, ncvm.NodCanvasModel); if (share != null) { ncvm.NodCanvasModel.LinjeListModel.Remove(share); share.LinjeViewModel.Delete(); } foreach (LinjeModel l in ncvm.NodCanvasModel.LinjeListModel) { l.ReplaceNod(ncvm.NodCanvasModel, this.NodCanvasModel); NodCanvasModel.LinjeListModel.Add(l); } } ncvm.Delete(); }