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 void SortArguments()
        {
            int fileCount = 0;

            //int optionCount = 0;
            if (this.argLen > 0)
            {
                foreach (string element in argArray)
                {
                    if (ArgumentOption(element))
                    {
                        this.optQueue.Enqueue(element.ToString());
                        //MessageBox.Show(element.ToString());
                        //optionCount++;
                    }
                    else
                    {
                        this.fileLocations.Enqueue(element);
                        //MessageBox.Show(element.ToString());
                        fileCount++;
                    }
                }
                if (fileCount == 1)
                {
                    this.files.fileIn = this.fileLocations.Dequeue();
                    this.fileLocations.Clear();
                }
                else if (fileCount > 1)
                {
                    this.files.fileIn  = this.fileLocations.Dequeue();
                    this.files.fileOut = this.fileLocations.Dequeue();
                    this.fileLocations.Clear();
                }
                this.Setfiles(files);
                this.ExecuteExtractFilename();
                this.files = this.Getfiles();
            }
        }
Beispiel #3
0
 //public void SetfileInString(string fileInString) { this.files.fileIn = fileInString; }
 //public void SetfileOutString(string fileOutString) { this.files.fileOut = fileOutString; }
 protected void Setfiles(fileLocation files)
 {
     this.files = files;
 }