public static ProjectNodeData Create(Project prj) { ProjectNodeData result = new ProjectNodeData(); result.Project = prj; result.ItemType = ProjectItemType.Project; return(result); }
public static ProjectNodeData Create(Project prj, ProjectItem item) { ProjectNodeData result = new ProjectNodeData(); result.Project = prj; result.Item = item; result.ItemType = item.ItemType; return(result); }
public int Compare(Object x, Object y) { TreeNode nx = x as TreeNode; TreeNode ny = y as TreeNode; ProjectNodeData dx = GetNodeData(nx); ProjectNodeData dy = GetNodeData(ny); if (dx == null && dy == null) { return(0); } else if (dx != null && dy == null) { return(-1); } else if (dx == null && dy != null) { return(1); } else if (dx.ItemType == ProjectItemType.Project && dy.ItemType != ProjectItemType.Project) { return(-1); } else if (dx.ItemType != ProjectItemType.Project && dy.ItemType == ProjectItemType.Project) { return(1); } else if (dx.ItemType == ProjectItemType.Project && dy.ItemType == ProjectItemType.Project) { if (dx.Project != null && dy.Project != null) { return(dx.Project.Name.ToLowerInvariant().CompareTo(dy.Project.Name.ToLowerInvariant())); } else { return(0); } } else if (dx.Item != null && dy.Item == null) { return(1); } else if (dx.Item == null && dy.Item != null) { return(0); } else if (dx.Item == null && dy.Item == null) { return(nx.Text.ToLowerInvariant().CompareTo(nx.Text.ToLowerInvariant())); } else { return(dx.Item.CompareTo(dy.Item)); } }