/// -----------------------------------------------------------------------------
        /// <summary>
        /// Convert single codefile.
        /// </summary>
        /// <param name="sourceFile">The full path and filename to the source codefile.</param>
        /// <param name="targetFile">The full path and filename to the destination codefile ([default] is same than sourceFile with changed extension).</param>
        /// <param name="overwriteExistingFile">True if existing file should be overwriten ([default] is false).</param>
        /// <param name="fixNamespaces">True if enable the append/remove default-using-statements as defined in the FixNamespaces Property ([default] is false).</param>
        /// -----------------------------------------------------------------------------
        public void ConvertFile(string sourceFile, string targetFile = "", bool overwriteExistingFile = false, bool fixNamespaces = false)
        {
            INetVertConverter      TmpConv;
            string                 TmpS;
            ProcessedFileEventArgs TmpE;
            string                 TmpFixNS = "";

            try {
                if (targetFile == "")
                {
                    targetFile = Path.ChangeExtension(sourceFile, "." + OutputFileExtension);
                }
                // ERROR: Not supported in C#: WithStatement

                FTotalCount += 1;
                if (File.Exists(targetFile) && !overwriteExistingFile)
                {
                    //Skipped, file exists
                    //OLD: OutputText("Skipped, file exists " & targetFile)
                    //RaiseEvent AfterFileProcessed(Me, New ProcessedFileEventArgs(sourceFile, 0, targetFile, 0, ProcessedFileEventArgs.FileStatus.Skipped_Exists, FLanguage, ""))
                    if (AfterFileProcessed != null)
                    {
                        AfterFileProcessed(this, new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.CodeFile, sourceFile, "", targetFile, "", ProcessedFileEventArgs.ConverterOperations.Skipped_Exists, FLanguage, ""));
                    }
                }
                else
                {
                    // ERROR: Not supported in C#: WithStatement

                    //create EventArgs
                    TmpE = new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.CodeFile, sourceFile, TmpS, targetFile, "", ProcessedFileEventArgs.ConverterOperations.Before_Conversion, FLanguage, "");
                    if (BeforeFileProcessed != null)
                    {
                        BeforeFileProcessed(this, TmpE);
                    }
                    //set Namespaces to fix
                    if (fixNamespaces)
                    {
                        TmpFixNS = FFixNamespaces;
                    }
                    //create Converter instance with apropreate language
                    if (FLanguage == ConverterLanguages.VBNetToCSharp)
                    {
                        TmpConv = VBCSConverter.Convert(TmpE.InputSource, TmpFixNS);
                    }
                    else if (FLanguage == ConverterLanguages.CSharpToVBNet)
                    {
                        TmpConv = CSVBConverter.Convert(TmpE.InputSource, TmpFixNS);
                    }
                    else
                    {
                        throw new Exception("Converter-Language not supported");
                    }
                    if (TmpConv.HasError)
                    {
                        //has an error
                        FFailedCount += 1;
                        //OLD: OutputText("Error in " & sourceFile & vbCrLf & TmpConv.ErrorText)
                        TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Skipped_Error, TmpConv.ErrorText);
                        if (AfterFileProcessed != null)
                        {
                            AfterFileProcessed(this, TmpE);
                        }
                    }
                    else
                    {
                        //no error
                        FConvertedCount += 1;
                        if (File.Exists(targetFile))
                        {
                            TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Success_Overwriting);
                            File.Delete(targetFile);
                        }
                        else
                        {
                            TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Success_Creating);
                        }
                        TmpE.OutputSource = TmpConv.OutputSource;
                        if (AfterFileProcessed != null)
                        {
                            AfterFileProcessed(this, TmpE);
                        }
                        //save new stream to file
                        try {
                            // ERROR: Not supported in C#: WithStatement
                        } catch (Exception ex) {
                            TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Skipped_Error, ex.Message);
                            if (AfterFileProcessed != null)
                            {
                                AfterFileProcessed(this, TmpE);
                            }
                        }
                    }
                }

#if (DEBUG)
            } catch (NetVertException ex) {
                //common error
                if (AfterFileProcessed != null)
                {
                    AfterFileProcessed(this, new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.CodeFile, sourceFile, "", targetFile, "", ProcessedFileEventArgs.ConverterOperations.Skipped_Error, FLanguage, ex.Message));
                }
#Else
            } catch (Exception ex) {
                //common error
                if (AfterFileProcessed != null)
                {
                    AfterFileProcessed(this, new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.CodeFile, sourceFile, "", targetFile, "", ProcessedFileEventArgs.ConverterOperations.Skipped_Error, FLanguage, ex.Message));
                }
#endif
            }
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Convert single ASPX file.
        /// </summary>
        /// <param name="sourceFile">The full path and filename to the source ASPX file.</param>
        /// <param name="targetFile">The full path and filename to the destination ASPX file.</param>
        /// <param name="overwriteExistingFile">True if existing file should be overwriten ([default] is false).</param>
        /// -----------------------------------------------------------------------------
        public void ConvertFile(string sourceFile, string targetFile, bool overwriteExistingFile = false)
        {
            ASPXConverter          TmpConv;
            string                 TmpS;
            ProcessedFileEventArgs TmpE;

            try {
                // ERROR: Not supported in C#: WithStatement

                FTotalCount += 1;
                if (File.Exists(targetFile) && !overwriteExistingFile)
                {
                    //Skipped, file exists
                    if (AfterFileProcessed != null)
                    {
                        AfterFileProcessed(this, new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.ASPXFile, sourceFile, "", targetFile, "", ProcessedFileEventArgs.ConverterOperations.Skipped_Exists, FLanguage, ""));
                    }
                }
                else
                {
                    // ERROR: Not supported in C#: WithStatement

                    //create EventArgs
                    TmpE = new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.ASPXFile, sourceFile, TmpS, targetFile, "", ProcessedFileEventArgs.ConverterOperations.Before_Conversion, FLanguage, "");
                    if (BeforeFileProcessed != null)
                    {
                        BeforeFileProcessed(this, TmpE);
                    }
                    //convert now
                    TmpConv = ASPXConverter.Convert(TmpS, FLanguage);
                    if (TmpConv.HasError)
                    {
                        //has an error
                        FFailedCount += 1;
                        TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Skipped_Error, TmpConv.ErrorText, TmpConv.ConverterLanguage);
                        if (AfterFileProcessed != null)
                        {
                            AfterFileProcessed(this, TmpE);
                        }
                    }
                    else
                    {
                        //no error
                        FConvertedCount += 1;
                        if (File.Exists(targetFile))
                        {
                            TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Success_Overwriting, "", TmpConv.ConverterLanguage);
                            File.Delete(targetFile);
                        }
                        else
                        {
                            TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Success_Creating, "", TmpConv.ConverterLanguage);
                        }
                        TmpE.OutputSource = TmpConv.ASPXOutputSource;
                        if (AfterFileProcessed != null)
                        {
                            AfterFileProcessed(this, TmpE);
                        }
                        //save new stream to file
                        try {
                            // ERROR: Not supported in C#: WithStatement
                        } catch (Exception ex) {
                            TmpE.ModifyStatus(ProcessedFileEventArgs.ConverterOperations.Skipped_Error, ex.Message);
                            if (AfterFileProcessed != null)
                            {
                                AfterFileProcessed(this, TmpE);
                            }
                        }
                    }
                }

#if (DEBUG)
            } catch (NetVertException ex) {
                //common error
                if (AfterFileProcessed != null)
                {
                    AfterFileProcessed(this, new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.ASPXFile, sourceFile, "", targetFile, "", ProcessedFileEventArgs.ConverterOperations.Skipped_Error, FLanguage, ex.Message));
                }
#Else
            } catch (Exception ex) {
                //common error
                if (AfterFileProcessed != null)
                {
                    AfterFileProcessed(this, new ProcessedFileEventArgs(ProcessedFileEventArgs.ConverterFileTypes.ASPXFile, sourceFile, "", targetFile, "", ProcessedFileEventArgs.ConverterOperations.Skipped_Error, FLanguage, ex.Message));
                }
#endif
            }


            //With Directory.GetParent(targetFile)
            //  If Not .Exists Then
            //    OutputText("Creating directory " & .FullName)
            //    .Create()
            //  End If
            //End With
            //FTotalCount += 1
            //If File.Exists(targetFile) AndAlso _
            //   Not overwriteExistingFile Then
            //  OutputText("Skipped, file exists " & targetFile)
            //Else

            //  TmpReader = File.OpenText(sourceFile)
            //  TmpS = TmpReader.ReadToEnd
            //  TmpReader.Close()
            //  'TmpError = ""
            //  TmpConv = ASPXConverter.Convert(TmpS, FLanguage)
            //  If TmpConv.HasError Then
            //    'has an error
            //    FFailedCount += 1
            //    OutputText("Error in " & sourceFile & vbCrLf & TmpConv.ErrorText)
            //  Else
            //    'no error
            //    If File.Exists(targetFile) Then
            //      OutputText("Overwriting " & targetFile)
            //    Else
            //      OutputText("Creating " & targetFile)
            //    End If
            //    FConvertedCount += 1
            //    TmpWriter = File.CreateText(targetFile)
            //    TmpWriter.Write(TmpConv.ASPXOutputSource)
            //    TmpWriter.Close()
            //  End If

            //End If
        }