예제 #1
0
        public void AddMesh()
        {
            MeshViewModel mesh = new MeshViewModel();

            MeshList.Add(mesh);
            RootLevel.Add(mesh);
        }
예제 #2
0
 private void Drop(MeshViewModel child)
 {
     if (child.Parent != null)
     {
         child.SetNewParent(null);
         RootLevel.Add(child);
     }
 }
예제 #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);
                }
            }
        }
예제 #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));
        }