Ejemplo n.º 1
0
        public void AddMesh()
        {
            MeshViewModel mesh = new MeshViewModel();

            MeshList.Add(mesh);
            RootLevel.Add(mesh);
        }
Ejemplo n.º 2
0
 private void Drop(MeshViewModel child)
 {
     if (child.Parent != null)
     {
         child.SetNewParent(null);
         RootLevel.Add(child);
     }
 }
Ejemplo n.º 3
0
        private void Mesh_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Parent")
            {
                //clean the root
                RootLevel.Where(x => x.Parent != null).ToList().All(x => RootLevel.Remove(x));

                // add the mesh to the root if necessary
                if (((MeshViewModel)sender).Parent == null && !RootLevel.Contains(((MeshViewModel)sender)))
                {
                    RootLevel.Add((MeshViewModel)sender);
                }
            }
        }
Ejemplo n.º 4
0
        public void AddUnsupportedNode(UnsupportedCommand unsupportedCommand)
        {
            var counterNode = RootLevel.OfType <UnsupportedCounter>().FirstOrDefault();

            if (counterNode == null)
            {
                counterNode = new UnsupportedCounter();
                RootLevel.Add(counterNode);
            }
            counterNode.Count(unsupportedCommand);

            var level     = CurrentLevelNodes;
            var container = level.OfType <UnsupportedContainer>().FirstOrDefault();

            if (container == null)
            {
                container = new UnsupportedContainer();
                level.Insert(0, container);
            }
            container.Add(new UnsupportedNode(unsupportedCommand));
        }