Пример #1
0
        public FolderGraph GetFolderGraph(string path)
        {
            if (!path.EndsWith("\\"))
            {
                path += "\\";
            }

            FolderGraph graph = new FolderGraph();

            graph.Hash = CalculateFileHash(path, path, graph.CheckSums);

            // copy hash to arrays
            graph.CheckSumKeys   = new uint[graph.CheckSums.Count];
            graph.CheckSumValues = new FileHash[graph.CheckSums.Count];
            graph.CheckSums.Keys.CopyTo(graph.CheckSumKeys, 0);
            graph.CheckSums.Values.CopyTo(graph.CheckSumValues, 0);

            return(graph);
        }
Пример #2
0
        public FolderGraph GetFolderGraph(string path)
        {
            if (!path.EndsWith("\\"))
                path += "\\";

            FolderGraph graph = new FolderGraph();
            graph.Hash = CalculateFileHash(path, path, graph.CheckSums);

            // copy hash to arrays
            graph.CheckSumKeys = new uint[graph.CheckSums.Count];
            graph.CheckSumValues = new FileHash[graph.CheckSums.Count];
            graph.CheckSums.Keys.CopyTo(graph.CheckSumKeys, 0);
            graph.CheckSums.Values.CopyTo(graph.CheckSumValues, 0);

            return graph;
        }