惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
F
Fortinet All Blogs
H
Help Net Security
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
L
LangChain Blog
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium

博客园 - 油纸伞

假如m是奇数,且m>=3,证明m(m² -1)能被8整除 GetRelativePath获取相对路径 Dictionary(支持 XML 序列化),注意C#中原生的Dictionary类是无法进行Xml序列化的 Winform中Checkbox与其他集合列表类型之间进行关联 Image(支持 XML 序列化),注意C#中原生的Image类是无法进行Xml序列化的 修复使用<code>XmlDocument</code>加载含有DOCTYPE的Xml时,加载后增加“[]”字符的错误 使用序列化来Clone对象 [转]PowerDesigner15生成Hibernate 用户自定义类型的隐式转换 Net3.5及以上版本INotifyPropertyChanged接口的友好用法 知识加油站 知识加油站 Top K算法详细解析 C#值类型和引用类型 Oracle分区技术 对Oracle表分区的一点认识 oracle创建分区表 数据库大表的优化:采用蔟表(clustered tables)及蔟索引(Clustered Index) 2008年.Net编程人员工具参照
SharpSvn操作 -- 获取Commit节点列表
油纸伞 · 2017-04-19 · via 博客园 - 油纸伞

 1         /// <summary>
 2         /// 获取工作目录的所有节点,包括子目录
 3         /// </summary>
 4         /// <param name="workingCopyDir"></param>
 5         /// <returns></returns>
 6         public List<LocalNode> FetchWorkingCopy(string workingCopyDir)
 7         {
 8             var nodes = new List<LocalNode>();
 9             var workingRoot = SvnClient.GetWorkingCopyRoot(workingCopyDir);
10             if (workingRoot == null)
11             {
12                 FetchNotVersionedDir(workingCopyDir, nodes);
13             }
14             else
15             {
16                 FetchWorkingCopyDir(workingCopyDir, nodes);
17             }
18             PrintLocalNodes(nodes);
19             return nodes;
20         }

View Code

 1         private void FetchWorkingCopyDir(string path, List<LocalNode> nodes)
 2         {
 3             var statusArgs = new SvnStatusArgs
 4             {
 5                 Depth = SvnDepth.Children,
 6                 RetrieveAllEntries = true,
 7                 ThrowOnError = false
 8             };
 9             Collection<SvnStatusEventArgs> list;
10             if (!SvnClient.GetStatus(path, statusArgs, out list))
11                 return;
12             for (var i = 1; i < list.Count; i++)
13             {
14                 var argse = list[i];
15                 if (argse.Versioned)
16                 {
17                     nodes.Add(new LocalNode { FullPath = argse.FullPath, NodeKind = argse.NodeKind, NodeStatus = argse.LocalNodeStatus });
18                     if (argse.NodeKind == SvnNodeKind.Directory)
19                         FetchWorkingCopyDir(argse.FullPath, nodes);
20                 }
21                 else
22                 {
23                     var nodeKind = File.Exists(argse.FullPath) ? SvnNodeKind.File : SvnNodeKind.Directory;
24                     nodes.Add(new LocalNode { FullPath = argse.FullPath, NodeKind = nodeKind, NodeStatus = argse.LocalNodeStatus });
25                     if (nodeKind == SvnNodeKind.Directory)
26                         FetchNotVersionedDir(argse.FullPath, nodes);
27                 }
28             }
29         }
30 
31         private void FetchNotVersionedDir(string path, List<LocalNode> nodes)
32         {
33             var files = Directory.GetFiles(path);
34             nodes.AddRange(files.Select(file => new LocalNode { FullPath = file, NodeKind = SvnNodeKind.File, NodeStatus = SvnStatus.NotVersioned }));
35             var dirs = Directory.GetDirectories(path);
36             foreach (var dir in dirs)
37             {
38                 nodes.Add(new LocalNode { FullPath = dir, NodeKind = SvnNodeKind.Directory, NodeStatus = SvnStatus.NotVersioned });
39                 FetchNotVersionedDir(dir, nodes);
40             }
41         }

View Code

1     public class LocalNode
2     {
3         public string FullPath { get; set; }
4         public SvnNodeKind NodeKind { get; set; }
5         public SvnStatus NodeStatus { get; set; }
6     }