Пример #1
0
    public static void Main(String[] args)
    {
        directory d = new directory();

        d["Jane Doe"] = "234-5678";
        Console.WriteLine(d["Jane Doe"]);
    }
Пример #2
0
    public static void Main(String[] args)
    {
        directory d = new directory();

        d["Jane Doe"] = "234-5678";
        Console.WriteLine(d["Jane Doe"]);
    }
Пример #3
0
        public directory get_dir(dir_path path)
        {
            directory d = new directory();

            try{
                d.get(path);
            } catch {
                return(d);
            }
            return(d);
        }
Пример #4
0
        //this metod are getting the path of the root folder, from the root folder they get all the under directories
        // If there are files in the root directionary those files will be added to the list "directories"
        public void Getfiles(string path)
        {
            //makeing the root path into a directory class
            // and adding it to the list of directory in case there are files in the root directory too
            directory maindir = new directory(path);

            directories.Add(maindir);
            //loops tropugh the list of directoies, it starts on 1 which is the root in the list of  directory ("dirctories")
            int trueres = 0;

            //this while loop stops then we have checked every directory in the list of directory for under directories
            while (directories.Count != trueres)
            {
                //loop tho the list of directory it stats on 1 with the root directory
                for (int i = 0; i < directories.Count; i++)
                {
                    //check if already read
                    if (directories[i].read == false)
                    {
                        //create a list of all the under directories paths
                        string[] dir = Directory.GetDirectories(directories[i].path);
                        //loop tho the list of the under directories
                        foreach (var item1 in dir)
                        {
                            //makeing each under directories path into a direcoty class
                            directory newdir = new directory(item1);
                            //adding it to the list of class directory
                            directories.Add(newdir);
                        }
                        //swich boolean variable in the directory class to read so not gonna be read again this while loop
                        directories[i].read = true;
                        //cout up the number of read directorys
                        trueres++;
                    }
                }
            }
            //at this point we have gotton all the under directories from the root directory
            //we are looping tho all the directories
            foreach (var item in directories)
            {
                //we are sorting all the files in all the directories
                Sortfiles(Directory.GetFiles(item.path));
            }
            xmlController.MakeXmlfile();        //makes the xmlfile
            xmlController.Insertpathtoxmldoc(); //insert the paths we found
            cmd.start();                        //start the pyton program through the commandline
            xmlController.InsertblackList();    //Insert the blacklist to the xml file
        }
Пример #5
0
        private void SetupHelloWorld(string content = "")
        {
            WriteFile(InputFilename, $"Some content {content}");

            SetConfig($@"
config({{
    modules: [f`./HelloWorld/module.config.dsc`],
    mounts: [
        {{
            name: a`myMount`,
            path: p`{TemporaryDirectory}`,
            trackSourceFileChanges: true,
            isReadable: true,
            isWritable: true,
        }},
     ]
}});");

            var spec = @$ "
import {{Artifact, Cmd, Tool, Transformer}} from 'Sdk.Transformers';

const directory = Context.getMount('myMount').path;
const foo : File = Transformer.copyFile(f`${{directory}}/{InputFilename}`, p`${{directory}}/{OutputFilename}`);
Пример #6
0
 public static DirectoryInfo Combine(this DirectoryInfo directory, params string[] paths) => new(CombineString(directory, paths));
 => Combine(directory, NewGuid().ToString());