/// <summary>
 /// Not Serializable, create a folder by specified parameter.
 /// </summary>
 /// <param name="parentFolder"></param>
 /// <param name="folderName"></param>
 /// <param name="destVariable"></param>
 /// <param name="nameGenerationMode"></param>
 /// <param name="nextCommand"></param>
 /// <returns></returns>
 public static IScriptCommand DiskCreateFolder(IEntryModel parentFolder, string folderName, string destVariable = "{Entry}",
                                               NameGenerationMode nameGenerationMode = NameGenerationMode.Rename, IScriptCommand nextCommand = null)
 {
     return(ScriptCommands.Assign("{DiskCreateFolder-Profile}", parentFolder, false,
                                  ScriptCommands.Assign("{DiskCreateFolder-Path}", parentFolder.Profile.Path.Combine(parentFolder.FullPath, folderName), false,
                                                        DiskCreateFolder("{DiskCreateFolder-Profile}", "{DiskCreateFolder-Path}", destVariable, nameGenerationMode, nextCommand))));
 }
Beispiel #2
0
        public static IFileNameGenerator FromNameGenerationMode(NameGenerationMode mode, string fileName)
        {
            switch (mode)
            {
            case NameGenerationMode.NoRename: return(NoRename(fileName));

            case NameGenerationMode.Rename: return(Rename(fileName));

            default: throw new NotSupportedException(mode.ToString());
            }
        }
 /// <summary>
 /// Serializable, For DiskProfile only, create a folder or file, requires Profile set to an IDiskProfile.
 /// </summary>
 /// <param name="pathVariable">Actual path or reference variable (if Bracketed), e.g. C:\Temp or {Path}.</param>
 /// <param name="isFolder"></param>
 /// <param name="destVariable"></param>
 /// <param name="nameGenerationMode"></param>
 /// <param name="nextCommand"></param>
 /// <returns></returns>
 public static IScriptCommand DiskCreatePath(string profileVariable = "{Profile}", string pathVariable = "{Path}", bool isFolder = false, string destVariable = "{Entry}",
                                             NameGenerationMode nameGenerationMode = NameGenerationMode.Rename, IScriptCommand nextCommand = null)
 {
     return(new DiskCreatePath()
     {
         ProfileKey = profileVariable,
         PathKey = pathVariable,
         IsFolder = isFolder,
         DestinationKey = destVariable,
         NameGenerationMode = nameGenerationMode,
         NextCommand = (ScriptCommandBase)nextCommand
     });
 }
 /// <summary>
 /// Serializable, For DiskProfile only, create a folder, requires Profile set to an IDiskProfile.
 /// </summary>
 /// <param name="pathVariable">Actual path or reference variable (if Bracketed), e.g. C:\Temp or {Path}.</param>
 /// <param name="destVariable"></param>
 /// <param name="nameGenerationMode"></param>
 /// <param name="nextCommand"></param>
 /// <returns></returns>
 public static IScriptCommand DiskCreateFolder(string profileVariable = "{Profile}", string pathVariable = "{Path}", string destVariable = "{Entry}",
                                               NameGenerationMode nameGenerationMode = NameGenerationMode.Rename, IScriptCommand nextCommand = null)
 {
     return(DiskCreatePath(profileVariable, pathVariable, true, destVariable, nameGenerationMode, nextCommand));
 }