Example #1
0
 public void HandleExpander(Expander exp, string dir, string file, Action<bool> finished)
 {
     if (file != null)
     {
         switch (exp.Type)
         {
             case ExpanderType.Text:
                 finished(WriteTextToFile(exp.Value, file));
                 break;
             case ExpanderType.OnlineFile:
                 DownloadFile(exp.Value, file, finished);
                 break;
             case ExpanderType.LocalFile:
                 finished(CopyFile(exp.Value, file));
                 break;
         }
     }
     else
     {
         switch (exp.Type)
         {
             case ExpanderType.OnlineFile:
                 DownloadArchive(exp.Value, dir, finished);
                 break;
             case ExpanderType.LocalDirectory:
                 finished(MoveDirectory(new DirectoryInfo(exp.Value), new DirectoryInfo(dir), false));
                 break;
         }
     }
 }
Example #2
0
 public ExpanderTask(Expander exp, string dir, string file)
 {
     Expander = exp;
     Directory = dir;
     File = file;
 }