在C#中使用Sharpsvn使用client.status [英] Using client.status in c# with sharpsvn

查看:116
本文介绍了在C#中使用Sharpsvn使用client.status的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用状态方法,但是我不明白它是如何工作的.有人可以给我看一个使用示例吗?

I want to use the status method but i dont understand how it works. Could someone show me an example of use please?

EventHandler < SvnStatusEventArgs > statusHandler = new EventHandler<SvnStatusEventArgs>(void(object, SvnStatusEventArgs) target);
client.Status(path, statusHandler);

推荐答案

好吧,它的工作原理与svn status命令完全相同:

Well, it'll work exactly like the svn status command : http://svnbook.red-bean.com/en/1.0/re26.html

您将获得泵送到EventHandler的文件列表:

You'll get the list of files pumped to the EventHandler:

using(SvnClient client = /* set up a client */ ){
    EventHandler<SvnStatusEventArgs> statusHandler = new EventHandler<SvnStatusEventArgs>(HandleStatusEvent);
    client.Status(@"c:\foo\some-working-copy", statusHandler);
}

...

void HandleStatusEvent (object sender, SvnStatusEventArgs args)
{
    switch(args.LocalContentStatus){
        case SvnStatus.Added: // Handle appropriately
            break;
    }

    // review other properties of 'args'
}

这篇关于在C#中使用Sharpsvn使用client.status的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆