Ejemplo n.º 1
0
 // Brings a particular node intoview.
 private void DiagramBringIntoView(Node node)
 {
     this.diagram.SelectedIndex = -1;
     var shape = this.diagram.ContainerGenerator.ContainerFromItem(node) as RadDiagramShape;
     if (shape != null)
     {
         this.diagram.BringIntoView(shape, 1, true);
     }
     shape.IsSelected = true;
 }
Ejemplo n.º 2
0
		private Node CreateNode(XElement element, Node parentNode)
		{
			Node node = new Node();
			node.PropertyChanged += this.OnNodePropertyChanged;
			node.FirstName = element.Attribute("FirstName").Value;
			node.LastName = element.Attribute("LastName").Value;
			node.Phone = element.Attribute("Phone").Value;
			node.Email = element.Attribute("Email").Value;
			node.Address = element.Attribute("Address").Value;
			node.Path = parentNode == null ? node.FullName : parentNode.Path + "|" + node.FullName;
			string imagePath = "Images/{0}{1}.jpg";
			node.ImagePath = string.Format(imagePath, node.FirstName, node.LastName);
			node.JobPosition = element.Attribute("Position").Value;
			node.Branch = (Branch)Enum.Parse(typeof(Branch), element.Attribute("Branch").Value, true);
			return node;
		}
Ejemplo n.º 3
0
		private ObservableCollection<HierarchicalNodeViewModel> GetSubNodes(XContainer element, Node parent)
		{
			var nodes = new ObservableCollection<HierarchicalNodeViewModel>();
			foreach (var subElement in element.Elements("Node"))
			{
				Node node = this.CreateNode(subElement, parent);
				node.Children.AddRange(this.GetSubNodes(subElement, node));
				nodes.Add(node);
			}
			return nodes;
		}
Ejemplo n.º 4
0
		private void TreeBringIntoView(Node node)
		{
			this.OrgTreeView.SelectedItems.Clear();
			this.OrgTreeView.BringPathIntoView(node.Path);
		}