C# subversion目录的大小

C# subversion目录的大小,c#,svn,visual-studio-2010,sharpsvn,C#,Svn,Visual Studio 2010,Sharpsvn,我有一个项目在sharpsvn的subversion下的目录中进行签出。我现在想做的是在进度条中显示签出过程,但为此我需要知道板的大小,我将返回目录的大小的库的什么属性或决定 提前谢谢 我通过签出成功地获得了要subversion的下载目录的大小,因此我得到了一个变量“total_size”,其中包含下载的总大小。现在,要在progressbar中显示下载过程,应捕获下载的位,与总数进行比较,并将其分配给progressbar,但不包括如何获取此数据。。。有人做过类似的事情吗?你能给我看一下那个

我有一个项目在sharpsvn的subversion下的目录中进行签出。我现在想做的是在进度条中显示签出过程,但为此我需要知道板的大小,我将返回目录的大小的库的什么属性或决定


提前谢谢

我通过签出成功地获得了要subversion的下载目录的大小,因此我得到了一个变量“total_size”,其中包含下载的总大小。现在,要在progressbar中显示下载过程,应捕获下载的位,与总数进行比较,并将其分配给progressbar,但不包括如何获取此数据。。。有人做过类似的事情吗?你能给我看一下那个属性和使用过的代码吗

              //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));
//此集合将包含每个节点的属性集合
System.Collections.ObjectModel.Collection proplist;
//在这里,我们可以为svn proplist指定参数
SvnPropertyListArgs args=新的SvnPropertyListArgs();
参数深度=SvnDepth无穷大;
//此方法执行svn proplist
GetPropertyList(targetSource、args、out-proplist);
//每个SvnPropertyListEventArgs代表该道具。为节点设置
foreach(proplist中的SVNPropertyListenTargets节点)
{
//每个SvnPropertyValue表示单个名称/值属性对
foreach(node.Properties中的SvnPropertyValue propVal)
{
items.items.Add(node.Path);
}
}
int total_items=items.items.Count;
长totalsize=0;
对于(int i=0;i

感谢

TortoiseSVN与checkout progressbar做了类似的事情,您可以签出它的源代码。

使用目录大小显示进度将不起作用-例如,实际的源代码大小可能是100 MB,但工作副本肯定会超过这个值(因为它保存的是原始副本)。