Hi all,
How can I access the SVN repository using SharpSVN and allow the user to select the project from a windows form.
Hi all,
How can I access the SVN repository using SharpSVN and allow the user to select the project from a windows form.
SharpSVN is used by SVNMonitor tool.
Now that SVNMonitor is open source, makes sense to take a look at its trunk to see how it’s implemented.
It's at
http://sharpregion.googlecode.com/svn/trunk/svnmonitor/trunk/
Some of the code from SVNMonitor using SharpSVN
using System;
using System.Collections.Generic;
using System.Text;
using SharpSvn;
using System.Net;
using SVNMonitor.Entities;
using System.Collections.ObjectModel;
using System.Windows.Forms;
using SVNMonitor.View.Dialogs;
using SVNMonitor.Helpers;
namespace SVNMonitor.SVN
{
internal class SharpSVNClient
{
#region Fields
private const string RecommendProperty = "svnmonitor:recommend";
#endregion Fields
#region Methods
private static SvnClient GetSvnClient()
{
SvnClient client = new SvnClient();
return client;
}
private static SvnClient GetSvnClient(Source source)
{
SvnClient client = GetSvnClient();
SetAuthentication(client, source);
return client;
}
private static void SetAuthentication(SvnClient client, Source source)
{
if (source.Authenticate)
{
SetAuthentication(client, source.UserName, source.Password);
}
else
{
SharpSvn.UI.SvnUI.Bind(client, (IWin32Window)null);
}
}
More at http://sharpregion.googlecode.com/svn/trunk/svnmonitor/trunk/SVNMonitor/SVN/SharpSVNClient.cs