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

推荐订阅源

Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
P
Privacy & Cybersecurity Law Blog
SecWiki News
SecWiki News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
Engineering at Meta
Engineering at Meta
Hugging Face - Blog
Hugging Face - Blog
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
The Exploit Database - CXSecurity.com
博客园_首页
Latest news
Latest news
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
罗磊的独立博客
月光博客
月光博客
C
Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
MyScale Blog
MyScale Blog
Spread Privacy
Spread Privacy
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
G
GRAHAM CLULEY
N
News and Events Feed by Topic
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
K
Kaspersky official blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
量子位
I
Intezer
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
About on SuperTechFans
D
DataBreaches.Net
宝玉的分享
宝玉的分享
S
Security @ Cisco Blogs
Help Net Security
Help Net Security
Hacker News - Newest:
Hacker News - Newest: "LLM"

博客园 - 油纸伞

假如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     }