예제 #1
0
        public virtual AttemptResult CopyDirectoryForeign(string src_path, StreamSystem dst, string dst_path, bool overwrite, long milliseconds = StreamSystem.DEFAULT_WAIT)
        {
            if (dst.CreateDirectory(dst_path, milliseconds).IsDesired())
            {
                AttemptResult result = AttemptResult.Succeeded;

                result = GetStreamNames(src_path).Apply(result,
                                                        (r, n) => r.GetAbsorbed(
                                                            CopyStreamForeign(
                                                                Filename.ForwardCombine(src_path, n),
                                                                dst,
                                                                Filename.ForwardCombine(dst_path, n),
                                                                overwrite,
                                                                milliseconds
                                                                )
                                                            )
                                                        );

                result = GetDirectoryNames(src_path).Apply(result,
                                                           (r, n) => r.GetAbsorbed(
                                                               CopyDirectoryForeign(
                                                                   Filename.ForwardCombine(src_path, n),
                                                                   dst,
                                                                   Filename.ForwardCombine(dst_path, n),
                                                                   overwrite,
                                                                   milliseconds
                                                                   )
                                                               )
                                                           );

                return(result);
            }

            return(AttemptResult.Failed);
        }
예제 #2
0
        static public string MakeDataPath(string directory)
        {
            string path = Filename.ForwardCombine(GetDataPath(), directory + "/");

            Directory.CreateDirectory(path);
            return(path);
        }
예제 #3
0
 static public string GetDataPath()
 {
     return(Filename.ForwardCombine(
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                ProgramInfo.GetId() + "/"
                ));
 }
예제 #4
0
 protected override string CalculatePath(string path)
 {
     return(Filename.ForwardCombine(directory, path));
 }