在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' }更多推荐
发布评论