繁体   English   中英

SharpSVN.DLL - C#.NET- 在 windows 应用程序中获取 SVN 存储库

[英]SharpSVN.DLL - C#.NET- Get SVN Repository in windows application

如何使用 SharpSVN 访问 SVN 存储库并允许用户从 windows 表单中访问 select 项目。

SharpSVN 由SVNMonitor工具使用。
既然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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM