/// <summary> /// /generate names and M C F params /// </summary> /// <param name="inputExtension">The input extension.</param> /// <param name="outputExtension">The output extension.</param> /// <returns></returns> public ConvertParametersForService GenerateName(String inputExtension, String outputExtension) { ConvertParametersForService convertParametersForService = new ConvertParametersForService(); convertParametersForService.McfParams.M = "1"; convertParametersForService.McfParams.F = ""; switch (outputExtension) { case "html": convertParametersForService.McfParams.C = "8"; break; case "docx": convertParametersForService.McfParams.C = "12"; break; case "pdf": convertParametersForService.McfParams.C = "17"; break; } convertParametersForService.ServiceFileNames.InputName = inputExtension + "_to_" + outputExtension + "_params_" + "cpr" + convertParametersForService.McfParams.C + "fpr" + convertParametersForService.McfParams.F + "mpr" + convertParametersForService.McfParams.M + "_" + Path.GetRandomFileName(); convertParametersForService.ServiceFileNames.OutputName = convertParametersForService.ServiceFileNames.InputName + "_converted"; return(convertParametersForService); }
/// <summary> /// generate output name and M C F params /// </summary> /// <param name="inputName">Name of the input.</param> /// <returns></returns> public ConvertParametersForService ParseName(String inputName) { ConvertParametersForService convertParametersForService = new ConvertParametersForService(); convertParametersForService.ServiceFileNames.OutputName = GetOutputName(inputName); convertParametersForService.ServiceFileNames.OutputExtension = GetExt(inputName); convertParametersForService.McfParams.C = GetCparam(inputName); convertParametersForService.McfParams.M = GetMparam(inputName); convertParametersForService.McfParams.F = GetFparam(inputName); return(convertParametersForService); }