public void ConnectToShapes(CompositeCollection coll)
 {
     _bodyVm = ParentVm.FindShape(LocalModelObject.BodyName, coll);
     if (_bodyVm == null)
     {
         MessageBox.Show("The shape pointed to by " + LocalModelObject.BodyName + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
 public override void Commit()
 {
     if (AddNewReservation())
     {
         ParentVm.UpdateList();
         Window.Close();
     }
 }
예제 #3
0
        public void RemovePoint(LfDragablePointViewModel point)
        {
            if (LocalModelObject == null)
            {
                return;
            }

            PointVms.Remove(point);
            LocalModelObject.RemovePoint(point.ModelObject);

            InvalidateAll();
            ParentVm.OnPropertyChanged("");
        }
예제 #4
0
        public async Task ChangeSourceAsync(StorageFile file)
        {
            if (file != null)
            {
                Source = MediaSource.CreateFromStorageFile(file);
                MediaControllingViewModel.ChangeMediaPlayerSource(Source);
                CurrentStorageFile = file;
                await VideoPropsViewModel.UpdateVideoPropsByStorageFile(file);

                ParentVm.RefreshTitle();
                ViewModelLocator.Current.TeachingTipsViewModel.StartIfAppropriate(3);
            }
        }
예제 #5
0
        public void ConnectToShapes(StateShapeCollectionViewModel shapes)
        {
            _aVm = ParentVm.FindShape(ModelObject.AName, shapes);
            if (_aVm == null)
            {
                MessageBox.Show("The shape A pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            _bVm = ParentVm.FindShape(ModelObject.BName, shapes);
            if (_bVm == null)
            {
                MessageBox.Show("The shape B pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #6
0
        private async Task ActionConnect()
        {
            IsLoading = true;
            var res = await AppServices.Client.Connect(ConnectHost);

            if (res == false)
            {
                await ParentVm.ShowMessage($"Не удалось подключиться к серверу {ConnectHost}", "Ошибка");

                IsLoading = false;
                return;
            }

            Status    = CloudTabStatus.ClientMode;
            IsLoading = false;
        }
예제 #7
0
        public new void ConnectToShapes(CompositeCollection coll)
        {
            _aVm = ParentVm.FindShape(ModelObject.AName, coll);
            if (_aVm == null)
            {
                MessageBox.Show("The shape A pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (ModelObject.BName != "notDef")
            {
                _bVm = ParentVm.FindShape(ModelObject.BName, coll);
                if (_bVm == null)
                {
                    MessageBox.Show("The shape B pointed to by " + ModelObject.Name + " does not exists in CO " + ParentVm.Name, "Error parsing file", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
예제 #8
0
        public LfDragablePointViewModel AddPoint(Point point)
        {
            if (LocalModelObject == null)
            {
                return(null);
            }

            LfDragablePoint          np       = new LfDragablePoint(GetFreeVertexIndex(), point.X, point.Y);
            LfDragablePointViewModel newPoint = new LfDragablePointViewModel(this, ParentVm, MainVm, this, np);

            PointVms.Add(newPoint);
            LocalModelObject.AddPoint(newPoint.ModelObject);

            InvalidateAll();
            ParentVm.OnPropertyChanged("");

            return(newPoint);
        }
예제 #9
0
 public override void Commit()
 {
     if (Current.Id == 0)
     {
         if (!AddNewKunde())
         {
             return;
         }
     }
     else
     {
         if (!SaveKunde())
         {
             return;
         }
     }
     ParentVm.UpdateList();
     Window.Close();
 }
예제 #10
0
        public ObjectFactoryPropertiesViewModel(
            TreeViewViewModel treeParent,
            CompoundObjectViewModel parentVm,
            MainViewModel mainVm,
            ObjectFactoryProperties modelObject,
            CoSystemViewModel systemViewModel) :
            base(treeParent, parentVm, mainVm, systemViewModel)
        {
            _modelObject = modelObject;

            if (_modelObject != null)
            {
                _bodyObject = ParentVm.FindBodyObject(_modelObject.Body);
            }

            foreach (SpawnObject so in LocalModelObject.SpawnObjects)
            {
                SpawnObjectViewModel sovm = new SpawnObjectViewModel(this, parentVm, mainVm, this, so);
                SpawnObjects.Add(sovm);
            }

            UpdateCornerPoints();
        }
예제 #11
0
        public LfDragablePointViewModel InsertPoint(Point insertMe, LfDragablePointViewModel insertBeforeMe)
        {
            if (LocalModelObject == null)
            {
                return(null);
            }

            LfDragablePoint          np       = new LfDragablePoint(GetFreeVertexIndex(), insertMe.X, insertMe.Y);
            LfDragablePointViewModel newPoint = new LfDragablePointViewModel(this, ParentVm, MainVm, this, np);

            int index = 0;

            if (insertBeforeMe != null)
            {
                index = PointVms.IndexOf(insertBeforeMe);
            }

            if (index >= 0)
            {
                PointVms.Insert(index, newPoint);
            }

            if (insertBeforeMe != null)
            {
                LocalModelObject.InsertPoint(newPoint.ModelObject, insertBeforeMe.ModelObject);
            }
            else
            {
                LocalModelObject.InsertPoint(newPoint.ModelObject, null);
            }

            InvalidateAll();
            ParentVm.OnPropertyChanged("");

            return(newPoint);
        }
예제 #12
0
        public Point ShapePointFromScene(Point scenePoint)
        {
            Point coPoint = ParentVm.GetCoPointFromScenePoint(scenePoint);

            return(ParentVm.CoPointInShape(coPoint, this));
        }
예제 #13
0
 // This method returns with the supplied point (expressed in the
 // shape's coordinate system) converted to the coordinate system
 // of the scene (i.e. that of the top level CompoundObject).
 public Point ScenePointFromShape(Point shapePoint)
 {
     return(ParentVm.GetScenePointFromCoPoint(ParentVm.ShapePointInCo(shapePoint, this)));
 }
예제 #14
0
 private void BaseTabModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     ParentVm.OnPropertychanged(e.PropertyName);
 }