示例#1
0
        public void DeleteDirectory()
        {
            if (!Directory.Exists(Default.Directory))
            {
                Directory.CreateDirectory(Default.Directory);
            }

            UVDirectory.Delete(Default.Directory, (e) => {
                Assert.IsNull(e);
            });

            Loop.Default.Run();
        }
        public static Task Delete(Loop loop, string path)
        {
            var tcs = new TaskCompletionSource <object>();

            try {
                UVDirectory.Delete(loop, path, (e) => {
                    if (e == null)
                    {
                        tcs.SetResult(null);
                    }
                    else
                    {
                        tcs.SetException(e);
                    }
                });
            } catch (Exception e) {
                tcs.SetException(e);
            }
            return(tcs.Task);
        }