i need to build some treeview pretty much similar to the one in P4V, where pending changelists are listed;
I could add the pending changelists to the treeview, and could add child nodes if i use GetFileName()
, however i want the file's LocalPath
, and if i try it, i get "Object reference not set to an instance of object".
IList<Changelist> lista;
Options opcoes = new Options(ChangesCmdFlags.FullDescription, con.Cliente.Name, 100, ChangeListStatus.Pending, con.Usuario);
lista = new List<Changelist>();
lista = con.Repositorio.GetChangelists(opcoes);
for (int i = 0; i < lista.Count; i++ )
{
Changelist change = new Changelist();
TreeNode node = new TreeNode();
change = lista[i];
change.initialize(con.conexao);
node = tre.Nodes.Add(change.Id.ToString());
FileSpec arquivoSpec = new FileSpec(new LocalPath(PathSpec.UnescapePath("")), Revision.Have);
for (int arquivoAtual = 0; arquivoAtual < change.Files.Count; arquivoAtual++)
{
node.Nodes.Add(change.Files[arquivoAtual].LocalPath.Path);
}
}
Any help will be appreciated.