SharpSVN.DLL - C # .NET - получить SVN репозиторий в приложении Windows - PullRequest
3 голосов
/ 24 марта 2009

Как я могу получить доступ к репозиторию SVN с помощью SharpSVN и позволить пользователю выбирать проект из формы Windows.

1 Ответ

5 голосов
/ 24 марта 2009

SharpSVN используется SVNMonitor tool.
Теперь, когда SVNMonitor является открытым исходным кодом, имеет смысл взглянуть на его ствол и посмотреть, как он реализован. Это в http://sharpregion.googlecode.com/svn/trunk/svnmonitor/trunk/

Часть кода из SVNMonitor, использующего 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);
            }
        }

Больше на http://sharpregion.googlecode.com/svn/trunk/svnmonitor/trunk/SVNMonitor/SVN/SharpSVNClient.cs

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...