在c#中使用带有sharpsvn的client.status(Using client.status in c# with sharpsvn)

编程入门 行业动态 更新时间:2024-10-19 16:29:58
在c#中使用带有sharpsvn的client.status(Using client.status in c# with sharpsvn)

我想使用状态方法,但我不明白它是如何工作的。 有人能告诉我一个使用的例子吗?

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

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命令完全相同: http : //svnbook.red-bean.com/en/1.0/re26.html

您将获得泵送到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' }

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

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' }

更多推荐

本文发布于:2023-07-16 13:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128973.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:sharpsvn   client   status

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!