コード例 #1
0
ファイル: chkClass.cs プロジェクト: ding99/CSharpSyntax
 private void dsp(GDir d)
 {
     Console.WriteLine(d.name);
     foreach (GFile f in d.files)
     {
         Console.WriteLine("  " + f.name + " " + f.loca + " / " + f.size);
     }
     if (d.dirs.Count > 0)
     {
         foreach (GDir f in d.dirs)
         {
             this.dsp(f);
         }
     }
 }
コード例 #2
0
ファイル: chkClass.cs プロジェクト: ding99/CSharpSyntax
        public void multit()
        {
            Console.ForegroundColor = ConsoleColor.Green;
            List <GFile> f_sub01 = new List <GFile> {
                new GFile {
                    name = "S01001", loca = 1, size = 10
                },
                new GFile {
                    name = "S01002", loca = 2, size = 20
                }
            };

            List <GFile> f_sub02 = new List <GFile> {
                new GFile {
                    name = "S02001", loca = 1, size = 10
                },
                new GFile {
                    name = "S02002", loca = 2, size = 20
                }
            };

            List <GFile> f_sub10 = new List <GFile> {
                new GFile {
                    name = "F02001", loca = 1, size = 10
                },
                new GFile {
                    name = "F02002", loca = 2, size = 20
                }
            };

            List <GDir> d_sub01 = new List <GDir> {
                new GDir {
                    name = "D001", files = f_sub01
                },
                new GDir {
                    name = "D002", files = f_sub02
                }
            };

            GDir P100 = new GDir {
                name = "top", dirs = d_sub01, files = f_sub10
            };

            Console.WriteLine(P100.name);
            this.dsp(P100);
        }
コード例 #3
0
ファイル: chkClass.cs プロジェクト: ding99/CSharpSyntax
 public GTree()
 {
     this.root  = String.Empty;
     this.entry = new GDir();
 }