Ejemplo n.º 1
0
        public static NodCanvasViewModel CopyNodKlassToNew(NodKlassModel nkm, NodCanvasRepository ncr)
        {
            NodCanvasModel     newNcm  = NodCanvasModel.CopyNod(nkm);
            NodCanvasViewModel newNcvm = new NodCanvasViewModel()
            {
                NodCanvasRepository = ncr,
                NodCanvasModel      = newNcm
            };

            return(newNcvm);
        }
Ejemplo n.º 2
0
 public void CreateLinje(Point p)
 {
     if (Set())
     {
         NodCanvasModel n = KlassViewModel.KlassRepository.MainRepository.NodCanvasRepository.AddNewCanvasNod(p).NodCanvasModel;
         LinjeViewModel l = KlassViewModel.KlassRepository.MainRepository.LinjeRepository.AddNewLinje(
             NodKlassModel,
             n
             );
     }
 }
Ejemplo n.º 3
0
        public void Select()
        {
            if (!IsSelected())
            {
                LinjeModel.IsSelected = true;
                LinjeRepository.IncreaseSelected();

                if (!LinjeModel.Nod1.IsSelected)
                {
                    if (LinjeModel.Nod1.LinjeListModel.Count == 1 || LinjeModel.Nod1.LinjeListModel.AllIsSelected())
                    {
                        if (LinjeModel.Nod1 is NodCanvasModel)
                        {
                            NodCanvasModel n = LinjeModel.Nod1 as NodCanvasModel;
                            n.NodCanvasViewModel.Select();
                        }
                        else
                        {
                            NodKlassModel n = LinjeModel.Nod1 as NodKlassModel;
                            n.NodKlassViewModel.Select();
                        }
                    }
                }

                if (!LinjeModel.Nod2.IsSelected)
                {
                    if (LinjeModel.Nod2.LinjeListModel.Count == 1 || LinjeModel.Nod2.LinjeListModel.AllIsSelected())
                    {
                        if (LinjeModel.Nod2 is NodCanvasModel)
                        {
                            NodCanvasModel n = LinjeModel.Nod2 as NodCanvasModel;
                            n.NodCanvasViewModel.Select();
                        }
                        else
                        {
                            NodKlassModel n = LinjeModel.Nod2 as NodKlassModel;
                            n.NodKlassViewModel.Select();
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
 public void Deselect(RajdElement re)
 {
     if (re is KlassModel)
     {
         KlassModel k = re as KlassModel;
         _klassRepository.Deselect(k.KlassViewModel);
     }
     else if (re is LinjeModel)
     {
         LinjeModel l = re as LinjeModel;
         _linjeRepository.Deselect(l.LinjeViewModel);
     }
     else if (re is NodCanvasModel)
     {
         NodCanvasModel n = re as NodCanvasModel;
         _nodCanvasRepository.Deselect(n.NodCanvasViewModel);
     }
     else if (re is TextBoxModel)
     {
         TextBoxModel t = re as TextBoxModel;
         _textBoxRepository.Deselect(t.TextBoxViewModel);
     }
 }
Ejemplo n.º 5
0
 public NodCanvasViewModel(Point p, NodCanvasRepository ncr)
 {
     NodCanvasModel      = new NodCanvasModel(p, this);
     NodCanvasRepository = ncr;
 }