views:

49

answers:

2

I have a project that takes a checkout in a directory under subversion by sharpsvn. I want to do now is to show the checkout process in a progress bar, but for that I need to know the size of the board, what property or decision of the library I would return the size of the directory?

Thanks in advance!

A: 

I managed to get the size of the download directory to subversion through the checkout, so I get a variable "total_size" with the overall size of the download. Now to display the download process in the progressbar should capture the bits downloaded to compare with the total and assign them to the progressbar, but not how to get this data ... has anyone done something similar? Will you show me that property and has used code?

              //This collection will contain property collections for each node
              System.Collections.ObjectModel.Collection<SvnPropertyListEventArgs> proplist;

              //This is where we can specify arguments to svn proplist
              SvnPropertyListArgs args = new SvnPropertyListArgs();

              args.Depth = SvnDepth.Infinity;

              //This method is what executes svn proplist
              client.GetPropertyList(targetSource, args, out proplist);

              //Each SvnPropertyListEventArgs represents the prop. set for a node
              foreach (SvnPropertyListEventArgs node in proplist)
              {
                  //Each SvnPropertyValue represents a single name/value property pair
                  foreach (SvnPropertyValue propVal in node.Properties)
                  {
                      items.Items.Add(node.Path);
                  }
              }

              int total_items = items.Items.Count;
              long totalsize = 0;
              for (int i = 0; i < total_items; i++)
              {
                  client.GetInfo(new Uri(items.Items[i].ToString()), out info);
                  totalsize = totalsize + info.RepositorySize;

              }
              MessageBox.Show(string.Format("The total size of {0} is {1}", targetSource, totalsize));

Thanks

Jesús
A: 

TortoiseSVN does something similar with a checkout progressbar, you can check out its sourcecode.

gbjbaanb