예제 #1
0
        private void DownloadWebDavContentRecursive(string currentWebDavPath, string currentLocalPath)
        {
            _webDavContentList.Clear();

            this.EnsureLocalFolderExists(currentLocalPath);

            autoResetEvent = new AutoResetEvent(false);
            // gehört hier nicht hin..
            // Evtl. mit einem dict
            WebDavClient.ListComplete += new ListCompleteDel(c_ListComplete);



            //WebDavClient.ListComplete += (list, statusCode) => {
            //    Debug.Assert(statusCode == 207);
            //    _webDavContentList = list;
            //    autoResetEvent.Set();
            //};

            WebDavClient.List(currentWebDavPath);
            autoResetEvent.WaitOne();
            List <WebDavContent> contentList = new List <WebDavContent>(_webDavContentList);

            foreach (WebDavContent item in contentList)
            {
                string fileName = item.FilePath;

                if (this.IsFolder(item))
                {
                    this.HandleFolder(currentLocalPath, item);
                }
                else
                {
                    this.HandleFile(currentLocalPath, item);
                }
            }
        }