Example #1
0
 // tworzy nowy MainDir na podstawie ścieżki !! uwaga metoda powinna być użyta tylko jeden raz ponieważ zawsze zwraca NOWEGO mainDira
 // nie testowana
 public IEditableDirWithChildren GetFolderAsNewMainDir(string fullName)
 {
     if (String.IsNullOrWhiteSpace(fullName))
     {
         throw new ArgumentException("full name is empty or null");
     }
     return(DirRead.GetMainDirFolder(fullName));
 }
Example #2
0
 public static DirManagement GetDefaultInstance()
 {
     if (InstanceDirManagement == null)
     {
         InstanceDirManagement = new DirManagement(DirRead.GetDefaultInstance(), DirValidate.GetDefaultInstance(), FileWrite.GetDefaultInstance());;
     }
     return(InstanceDirManagement);
 }
        //singleton

        public static DirRead GetDefaultInstance()
        {
            if (InstanceDirRead == null)
            {
                InstanceDirRead = new DirRead();
            }
            return(InstanceDirRead);
        }
Example #4
0
 public static DirManagement InitializeInstance(DirRead dirRead, DirValidate dirValidate, FileWrite fileWrite)
 {
     return(new DirManagement(dirRead, dirValidate, fileWrite));;
 }
Example #5
0
 //konstruktor do  wstrzykiwania singletonów przez metody
 private DirManagement(DirRead dirRead, DirValidate dirValidate, FileWrite fileWrite)
 {
     this.DirRead     = dirRead;
     this.DirValidate = dirValidate;
     this.FileWrite   = fileWrite;
 }
 public static DirNameGenerator GetInstance(DirValidate dirValidate, DirRead dirRead)
 {
     return(new DirNameGenerator(dirValidate, dirRead));
 }
 public static DirNameGenerator GetDefaultInstance()
 {
     InstanceDirNameGenerator = InstanceDirNameGenerator ??
                                new DirNameGenerator(DirValidate.GetDefaultInstance(), DirRead.GetDefaultInstance());
     return(InstanceDirNameGenerator);
 }
 public DirNameGenerator(DirValidate dirValidate, DirRead dirRead)
 {
     this.dirValidate = dirValidate;
     this.dirRead     = dirRead;
 }