簡體   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