Exemplo n.º 1
0
        private static bool MobiIt(string InputFile)
        {
            GatherFileInformation fileHandler = new GatherFileInformation(InputFile);

            if (fileHandler.FileInExtension.ToLower() == ".opf")
            {
                CleanOpfFile(fileHandler.FileInFullPath);
            }
            ProcessInformation mobiApp = new ProcessInformation();

            mobiApp.applicationString    = Properties.Settings.Default.MobigenPath;
            mobiApp.applicationSwitch    = null;
            mobiApp.applicationArgString = fileHandler.FileInEscaped;
            ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);

            if (!File.Exists(fileHandler.FileInLocation + "\\" + fileHandler.FileInNameNoExtension + ".mobi"))
            {
                DialogResult fileConvertFailed = MessageBox.Show("Display Error Information?", "Conversion Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                if (fileConvertFailed == DialogResult.Yes)
                {
                    MessageBox.Show(mobiProcessor.GetapplicationStdOutput());
                }
                return(false);
            }
            return(true);
        }
 public static bool MobiIt(string HTMLFile)
 {
     fileLocation mobiFiles = new fileLocation();
     GatherFileInformation fileHandler = new GatherFileInformation(HTMLFile);
     mobiFiles = fileHandler.Getfiles();
     if (mobiFiles.fileExt.ToLower() == "html" || mobiFiles.fileExt.ToLower() == "htm")
     {
         ProcessInformation mobiApp = new ProcessInformation();
         mobiApp.applicationString = @"app\mobigen.exe";
         mobiApp.applicationSwitch = null;
         mobiApp.applicationArgString = "\"" + mobiFiles.fileLocationDir + "\\" + mobiFiles.fileName + "." + mobiFiles.fileExt + "\"";
         ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
         if (!File.Exists(mobiFiles.fileLocationDir + "\\" + mobiFiles.fileName + ".mobi"))
         {
             DialogResult fileConvertFailed = MessageBox.Show("Display Error Information?", "Conversion Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
             if (fileConvertFailed == DialogResult.Yes)
             {
                 MessageBox.Show(mobiProcessor.GetapplicationStdOutput());
             }
             return false;
         }
         return true;
     }
     return false;
 }
        public static bool MobiIt(string HTMLFile)
        {
            fileLocation          mobiFiles   = new fileLocation();
            GatherFileInformation fileHandler = new GatherFileInformation(HTMLFile);

            mobiFiles = fileHandler.Getfiles();
            if (mobiFiles.fileExt.ToLower() == "html" || mobiFiles.fileExt.ToLower() == "htm")
            {
                ProcessInformation mobiApp = new ProcessInformation();
                mobiApp.applicationString    = @"app\mobigen.exe";
                mobiApp.applicationSwitch    = null;
                mobiApp.applicationArgString = "\"" + mobiFiles.fileLocationDir + "\\" + mobiFiles.fileName + "." + mobiFiles.fileExt + "\"";
                ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
                if (!File.Exists(mobiFiles.fileLocationDir + "\\" + mobiFiles.fileName + ".mobi"))
                {
                    DialogResult fileConvertFailed = MessageBox.Show("Display Error Information?", "Conversion Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    if (fileConvertFailed == DialogResult.Yes)
                    {
                        MessageBox.Show(mobiProcessor.GetapplicationStdOutput());
                    }
                    return(false);
                }
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
 public ArgumentHandler()
 {
     this.fileLocations = new Queue <string>();
     this.optQueue      = new Queue <string>();
     argArray           = null;
     this.argLen        = 0;
     this.files         = new GatherFileInformation();
     //this.currentLocation=0;
 }
 public ArgumentHandler()
 {
     this.fileLocations = new Queue<string>();
     this.optQueue = new Queue<string>();
     argArray = null;
     this.argLen = 0;
     this.files = new GatherFileInformation();
     //this.currentLocation=0;
 }
        static void Main(string[] args)
        {
            GatherFileInformation filehandler = new GatherFileInformation();

            if (args.Length == 0)
            {
                if (filehandler.ExecuteFileOpen())
                {
                    if (filehandler.ExecuteFolderSelect())
                    {
                        try
                        {
                            FileConvert.ConvertFile(filehandler);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Conversion Failed for: " + filehandler.FileInFullPath + "\n" + ex.ToString());
                        }
                    }
                }
            }
            else
            {
                ArgumentHandler arguments = new ArgumentHandler(args);
                filehandler = arguments.files;
                if (filehandler.FileOutLocation == null)
                {
                    if (Properties.Settings.Default.DefaultOutPath != null)
                    {
                        try
                        {
                            filehandler.FileOutLocation = Properties.Settings.Default.DefaultOutPath;
                            FileConvert.ConvertFile(filehandler);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Conversion Failed for: " + filehandler.FileInFullPath + "\n" + ex.ToString());
                        }
                    }
                    else
                    {

                        if (filehandler.ExecuteFolderSelect())
                        {
                            try
                            {
                                FileConvert.ConvertFile(filehandler);
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine("Conversion Failed for: " + filehandler.FileInFullPath + "\n" + ex.ToString());
                            }
                        }
                    }
                }
            }
        }
        static void Main(string[] args)
        {
            GatherFileInformation filehandler = new GatherFileInformation();

            if (args.Length == 0)
            {
                if (filehandler.ExecuteFileOpen())
                {
                    if (filehandler.ExecuteFolderSelect())
                    {
                        try
                        {
                            FileConvert.ConvertFile(filehandler);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Conversion Failed for: " + filehandler.FileInFullPath + "\n" + ex.ToString());
                        }
                    }
                }
            }
            else
            {
                ArgumentHandler arguments = new ArgumentHandler(args);
                filehandler = arguments.files;
                if (filehandler.FileOutLocation == null)
                {
                    if (Properties.Settings.Default.DefaultOutPath != null)
                    {
                        try
                        {
                            filehandler.FileOutLocation = Properties.Settings.Default.DefaultOutPath;
                            FileConvert.ConvertFile(filehandler);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Conversion Failed for: " + filehandler.FileInFullPath + "\n" + ex.ToString());
                        }
                    }
                    else
                    {
                        if (filehandler.ExecuteFolderSelect())
                        {
                            try
                            {
                                FileConvert.ConvertFile(filehandler);
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine("Conversion Failed for: " + filehandler.FileInFullPath + "\n" + ex.ToString());
                            }
                        }
                    }
                }
            }
        }
 private void OutputSelect_Click(object sender, RoutedEventArgs e)
 {
     //fileLocation fileLoc;
     GatherFileInformation filehandler = new GatherFileInformation();
     OutputLocTxtBox.Text = filehandler.ExecuteFolderSelect();
 }
        static void Main(string[] args)
        {
            GlobalTools.CheckPathInRegRestart("thing");
            GatherFileInformation filehandler = new GatherFileInformation();
            ProcessInformation mobi2mobiApp = new ProcessInformation();
            ProcessInformation clitApp = new ProcessInformation();
            ProcessInformation pdbApp = new ProcessInformation();
            ProcessInformation chmApp = new ProcessInformation();
            ProcessInformation pdfApp = new ProcessInformation();
            string workingDir = GlobalTools.GetexeLocation();
            string tempFolder = workingDir + @"Temp\";
            mobi2mobiApp.applicationString = @"app\mobi2mobi.exe";
            mobi2mobiApp.applicationString = null;
            clitApp.applicationString = @"app\c**t.exe";
            clitApp.applicationSwitch = @"-d";
            pdbApp.applicationString = @"app\abcpalm.exe";
            pdbApp.applicationSwitch = null;
            chmApp.applicationString = @"app\chmdecoder.exe";
            chmApp.applicationSwitch = @"-menu";
            pdfApp.applicationString = @"app\pdftohtml.exe";
            pdfApp.applicationSwitch = @"-noframes -c";
            fileLocation fileLocs;
            if (args.Length == 0)
            {
                filehandler.ExecuteFileOpen();
                filehandler.ExecuteFolderSelect();
                fileLocs = filehandler.files;
                if (fileLocs.fileExt.ToLower() == "htm")
                {
                    fileLocs.fileTemp = fileLocs.fileExt;
                    fileLocs.fileExt = "html";
                }

                switch (fileLocs.fileExt.ToLower())
                {
                    case "html":
                        if (fileLocs.fileTemp == "htm")
                        {
                            fileLocs.fileExt = fileLocs.fileTemp;
                        }
                        if (FileConvert.MobiIt(fileLocs.fileIn))
                        {
                            GlobalTools.MoveFile(fileLocs.fileLocationDir + "\\" + fileLocs.fileName + ".mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                        }
                        //mobiApp.applicationArgString = fileLocs.fileIn_Escape;
                        //ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
                        break;
                    case "mobi":
                        string newTitle = Interaction.InputBox("Enter a New Title for This Book", "MetaData Manipulation", fileLocs.fileName, 100, 100);
                        mobi2mobiApp.applicationArgString = @"--title " + "\"" + newTitle + "\" " + fileLocs.fileIn_Escape + @" --outfile " + fileLocs.fileIn_Escape;
                        ExecuteExternalProcessor mobi2mobiProcessor = new ExecuteExternalProcessor(mobi2mobiApp);
                        break;
                    case "pdb":
                        pdbApp.applicationArgString = fileLocs.fileIn_Escape + " \"" +  tempFolder + fileLocs.fileName + ".html\" \"1\"";
                        //MessageBox.Show(pdbApp.applicationArgString);
                        ExecuteExternalProcessor pdbProcessor = new ExecuteExternalProcessor(pdbApp);
                        if (FileConvert.MobiIt(tempFolder + fileLocs.fileName + ".html"))
                        {
                            GlobalTools.MoveFile(fileLocs.fileLocationDir + "\\" + fileLocs.fileName + ".mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                        }
                        break;
                    case "lit":
                        clitApp.applicationArgString = fileLocs.fileIn_Escape +" \"" + tempFolder + "\"";
                        ExecuteExternalProcessor litProcessor = new ExecuteExternalProcessor(clitApp);
                        if (GlobalTools.FileExist(tempFolder + fileLocs.fileName + ".html"))
                        {
                            if (FileConvert.MobiIt(tempFolder + fileLocs.fileName + ".html"))
                            {
                                GlobalTools.MoveFile(fileLocs.fileLocationDir + "\\" + fileLocs.fileName + ".mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                            }
                        }
                        else
                        {
                            MessageBox.Show(litProcessor.GetapplicationErrorOutput(), "Lit Convert Failed");
                        }
                        break;
                    case "chm":
                        if (fileLocs.fileIn_Escape == "1")
                        {
                            chmApp.applicationArgString = fileLocs.fileIn_Escape + " \"" + tempFolder + "\"";
                            ExecuteExternalProcessor chmProcessor = new ExecuteExternalProcessor(chmApp);
                        }
                        break;
                    case "pdf":
                        pdfApp.applicationArgString = fileLocs.fileIn_Escape + " \"";
                        ExecuteExternalProcessor pdfProcessor = new ExecuteExternalProcessor(pdfApp);
                        if (FileConvert.MobiIt(tempFolder + fileLocs.fileName + "s.html"))
                        {
                            GlobalTools.MoveFile(tempFolder + fileLocs.fileName + "s.mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                        }
                        break;
                    default:
                        MessageBox.Show("File type not supported", "Not Supported");
                        break;
                }
            }
            else
            {
                ArgumentHandler arguments = new ArgumentHandler(args);
                fileLocs = arguments.files;
                if (fileLocs.fileOut == null)
                {
                    fileLocs.fileOut = filehandler.ExecuteFolderSelect();
                }
            }
        }
 public static void ConvertFile(GatherFileInformation filehandler)
 {
     switch (filehandler.FileInExtension.ToLower())
     {
         case ".htm":
         case ".html":
             if (FileConvert.MobiIt(filehandler.FileInName))
             {
                 GlobalTools.MoveFile(filehandler.FileInLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi");
             }
             //mobiApp.applicationArgString = filehandler.FileInEscaped;
             //ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
             break;
         case ".mobi":
             string newTitle = Interaction.InputBox("Enter a New Title for This Book", "MetaData Manipulation", filehandler.FileInName, 100, 100);
             mobi2mobiApp.applicationArgString = @"--title " + "\"" + newTitle + "\" " + filehandler.FileInEscaped + @" --outfile " + filehandler.FileInEscaped;
             ExecuteExternalProcessor mobi2mobiProcessor = new ExecuteExternalProcessor(mobi2mobiApp);
             break;
         case ".pdb":
             pdbApp.applicationArgString = filehandler.FileInEscaped + " \"" + tempFolder + filehandler.FileInName + ".html\" \"1\"";
             //MessageBox.Show(pdbApp.applicationArgString);
             ExecuteExternalProcessor pdbProcessor = new ExecuteExternalProcessor(pdbApp);
             if (FileConvert.MobiIt(tempFolder + filehandler.FileInName + ".html"))
             {
                 GlobalTools.MoveFile(filehandler.FileInLocation + "\\" + filehandler.FileInName + ".mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInName + ".mobi");
             }
             break;
         case ".lit":
             string outPath = filehandler.TempLocation + filehandler.FileInNameNoExtension.Replace("'", "");
             if(!Directory.Exists(outPath))
             {
                 Directory.CreateDirectory(outPath);
             }
             clitApp.applicationArgString = "\"" + filehandler.FileInFullPath + "\" \"" + outPath + "\"";
             ExecuteExternalProcessor litProcessor = new ExecuteExternalProcessor(clitApp);
             if (GlobalTools.FileExist(outPath + "\\" + filehandler.FileInNameNoExtension + ".opf"))
             {
                 if (FileConvert.MobiIt(outPath + "\\" + filehandler.FileInNameNoExtension + ".opf"))
                 {
                     GlobalTools.MoveFile(outPath + "\\" + filehandler.FileInNameNoExtension + ".mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi");
                 }
             }
             else
             {
                 MessageBox.Show(litProcessor.GetapplicationErrorOutput(), "Lit Convert Failed");
             }
             break;
         case ".chm":
             if (filehandler.FileInEscaped == "1")
             {
                 chmApp.applicationArgString = filehandler.FileInEscaped + " \"" + tempFolder + "\"";
                 ExecuteExternalProcessor chmProcessor = new ExecuteExternalProcessor(chmApp);
             }
             break;
         case ".pdf":
             pdfApp.applicationArgString = filehandler.FileInEscaped + " \"" + filehandler.TempLocation + "\\" + filehandler.FileInNameNoExtension +"\"";
             ExecuteExternalProcessor pdfProcessor = new ExecuteExternalProcessor(pdfApp);
             if (FileConvert.MobiIt(tempFolder + "\\" + filehandler.FileInNameNoExtension + "s.html"))
             {
                 GlobalTools.MoveFile(tempFolder + "\\" + filehandler.FileInNameNoExtension + "s.mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi");
             }
             break;
         default:
             MessageBox.Show("File type not supported", "Not Supported");
             break;
     }
 }
 private static bool MobiIt(string InputFile)
 {
     GatherFileInformation fileHandler = new GatherFileInformation(InputFile);
     if (fileHandler.FileInExtension.ToLower() == ".opf")
     {
         CleanOpfFile(fileHandler.FileInFullPath);
     }
     ProcessInformation mobiApp = new ProcessInformation();
     mobiApp.applicationString = Properties.Settings.Default.MobigenPath;
     mobiApp.applicationSwitch = null;
     mobiApp.applicationArgString = fileHandler.FileInEscaped;
     ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
     if (!File.Exists(fileHandler.FileInLocation + "\\" + fileHandler.FileInNameNoExtension + ".mobi"))
     {
         DialogResult fileConvertFailed = MessageBox.Show("Display Error Information?", "Conversion Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
         if (fileConvertFailed == DialogResult.Yes)
         {
             MessageBox.Show(mobiProcessor.GetapplicationStdOutput());
         }
         return false;
     }
     return true;
 }
Exemplo n.º 12
0
        public static void ConvertFile(GatherFileInformation filehandler)
        {
            switch (filehandler.FileInExtension.ToLower())
            {
            case ".htm":
            case ".html":
                if (FileConvert.MobiIt(filehandler.FileInName))
                {
                    GlobalTools.MoveFile(filehandler.FileInLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi");
                }
                //mobiApp.applicationArgString = filehandler.FileInEscaped;
                //ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
                break;

            case ".mobi":
                string newTitle = Interaction.InputBox("Enter a New Title for This Book", "MetaData Manipulation", filehandler.FileInName, 100, 100);
                mobi2mobiApp.applicationArgString = @"--title " + "\"" + newTitle + "\" " + filehandler.FileInEscaped + @" --outfile " + filehandler.FileInEscaped;
                ExecuteExternalProcessor mobi2mobiProcessor = new ExecuteExternalProcessor(mobi2mobiApp);
                break;

            case ".pdb":
                pdbApp.applicationArgString = filehandler.FileInEscaped + " \"" + tempFolder + filehandler.FileInName + ".html\" \"1\"";
                //MessageBox.Show(pdbApp.applicationArgString);
                ExecuteExternalProcessor pdbProcessor = new ExecuteExternalProcessor(pdbApp);
                if (FileConvert.MobiIt(tempFolder + filehandler.FileInName + ".html"))
                {
                    GlobalTools.MoveFile(filehandler.FileInLocation + "\\" + filehandler.FileInName + ".mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInName + ".mobi");
                }
                break;

            case ".lit":
                string outPath = filehandler.TempLocation + filehandler.FileInNameNoExtension.Replace("'", "");
                if (!Directory.Exists(outPath))
                {
                    Directory.CreateDirectory(outPath);
                }
                clitApp.applicationArgString = "\"" + filehandler.FileInFullPath + "\" \"" + outPath + "\"";
                ExecuteExternalProcessor litProcessor = new ExecuteExternalProcessor(clitApp);
                if (GlobalTools.FileExist(outPath + "\\" + filehandler.FileInNameNoExtension + ".opf"))
                {
                    if (FileConvert.MobiIt(outPath + "\\" + filehandler.FileInNameNoExtension + ".opf"))
                    {
                        GlobalTools.MoveFile(outPath + "\\" + filehandler.FileInNameNoExtension + ".mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi");
                    }
                }
                else
                {
                    MessageBox.Show(litProcessor.GetapplicationErrorOutput(), "Lit Convert Failed");
                }
                break;

            case ".chm":
                if (filehandler.FileInEscaped == "1")
                {
                    chmApp.applicationArgString = filehandler.FileInEscaped + " \"" + tempFolder + "\"";
                    ExecuteExternalProcessor chmProcessor = new ExecuteExternalProcessor(chmApp);
                }
                break;

            case ".pdf":
                pdfApp.applicationArgString = filehandler.FileInEscaped + " \"" + filehandler.TempLocation + "\\" + filehandler.FileInNameNoExtension + "\"";
                ExecuteExternalProcessor pdfProcessor = new ExecuteExternalProcessor(pdfApp);
                if (FileConvert.MobiIt(tempFolder + "\\" + filehandler.FileInNameNoExtension + "s.html"))
                {
                    GlobalTools.MoveFile(tempFolder + "\\" + filehandler.FileInNameNoExtension + "s.mobi", filehandler.FileOutLocation + "\\" + filehandler.FileInNameNoExtension + ".mobi");
                }
                break;

            default:
                MessageBox.Show("File type not supported", "Not Supported");
                break;
            }
        }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            GlobalTools.CheckPathInRegRestart("thing");
            GatherFileInformation filehandler  = new GatherFileInformation();
            ProcessInformation    mobi2mobiApp = new ProcessInformation();
            ProcessInformation    clitApp      = new ProcessInformation();
            ProcessInformation    pdbApp       = new ProcessInformation();
            ProcessInformation    chmApp       = new ProcessInformation();
            ProcessInformation    pdfApp       = new ProcessInformation();
            string workingDir = GlobalTools.GetexeLocation();
            string tempFolder = workingDir + @"Temp\";

            mobi2mobiApp.applicationString = @"app\mobi2mobi.exe";
            mobi2mobiApp.applicationString = null;
            clitApp.applicationString      = @"app\c**t.exe";
            clitApp.applicationSwitch      = @"-d";
            pdbApp.applicationString       = @"app\abcpalm.exe";
            pdbApp.applicationSwitch       = null;
            chmApp.applicationString       = @"app\chmdecoder.exe";
            chmApp.applicationSwitch       = @"-menu";
            pdfApp.applicationString       = @"app\pdftohtml.exe";
            pdfApp.applicationSwitch       = @"-noframes -c";
            fileLocation fileLocs;

            if (args.Length == 0)
            {
                filehandler.ExecuteFileOpen();
                filehandler.ExecuteFolderSelect();
                fileLocs = filehandler.files;
                if (fileLocs.fileExt.ToLower() == "htm")
                {
                    fileLocs.fileTemp = fileLocs.fileExt;
                    fileLocs.fileExt  = "html";
                }

                switch (fileLocs.fileExt.ToLower())
                {
                case "html":
                    if (fileLocs.fileTemp == "htm")
                    {
                        fileLocs.fileExt = fileLocs.fileTemp;
                    }
                    if (FileConvert.MobiIt(fileLocs.fileIn))
                    {
                        GlobalTools.MoveFile(fileLocs.fileLocationDir + "\\" + fileLocs.fileName + ".mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                    }
                    //mobiApp.applicationArgString = fileLocs.fileIn_Escape;
                    //ExecuteExternalProcessor mobiProcessor = new ExecuteExternalProcessor(mobiApp);
                    break;

                case "mobi":
                    string newTitle = Interaction.InputBox("Enter a New Title for This Book", "MetaData Manipulation", fileLocs.fileName, 100, 100);
                    mobi2mobiApp.applicationArgString = @"--title " + "\"" + newTitle + "\" " + fileLocs.fileIn_Escape + @" --outfile " + fileLocs.fileIn_Escape;
                    ExecuteExternalProcessor mobi2mobiProcessor = new ExecuteExternalProcessor(mobi2mobiApp);
                    break;

                case "pdb":
                    pdbApp.applicationArgString = fileLocs.fileIn_Escape + " \"" + tempFolder + fileLocs.fileName + ".html\" \"1\"";
                    //MessageBox.Show(pdbApp.applicationArgString);
                    ExecuteExternalProcessor pdbProcessor = new ExecuteExternalProcessor(pdbApp);
                    if (FileConvert.MobiIt(tempFolder + fileLocs.fileName + ".html"))
                    {
                        GlobalTools.MoveFile(fileLocs.fileLocationDir + "\\" + fileLocs.fileName + ".mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                    }
                    break;

                case "lit":
                    clitApp.applicationArgString = fileLocs.fileIn_Escape + " \"" + tempFolder + "\"";
                    ExecuteExternalProcessor litProcessor = new ExecuteExternalProcessor(clitApp);
                    if (GlobalTools.FileExist(tempFolder + fileLocs.fileName + ".html"))
                    {
                        if (FileConvert.MobiIt(tempFolder + fileLocs.fileName + ".html"))
                        {
                            GlobalTools.MoveFile(fileLocs.fileLocationDir + "\\" + fileLocs.fileName + ".mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                        }
                    }
                    else
                    {
                        MessageBox.Show(litProcessor.GetapplicationErrorOutput(), "Lit Convert Failed");
                    }
                    break;

                case "chm":
                    if (fileLocs.fileIn_Escape == "1")
                    {
                        chmApp.applicationArgString = fileLocs.fileIn_Escape + " \"" + tempFolder + "\"";
                        ExecuteExternalProcessor chmProcessor = new ExecuteExternalProcessor(chmApp);
                    }
                    break;

                case "pdf":
                    pdfApp.applicationArgString = fileLocs.fileIn_Escape + " \"";
                    ExecuteExternalProcessor pdfProcessor = new ExecuteExternalProcessor(pdfApp);
                    if (FileConvert.MobiIt(tempFolder + fileLocs.fileName + "s.html"))
                    {
                        GlobalTools.MoveFile(tempFolder + fileLocs.fileName + "s.mobi", fileLocs.fileOut + "\\" + fileLocs.fileName + ".mobi");
                    }
                    break;

                default:
                    MessageBox.Show("File type not supported", "Not Supported");
                    break;
                }
            }
            else
            {
                ArgumentHandler arguments = new ArgumentHandler(args);
                fileLocs = arguments.files;
                if (fileLocs.fileOut == null)
                {
                    fileLocs.fileOut = filehandler.ExecuteFolderSelect();
                }
            }
        }