If we select folder Gmail which contains another folder All mail where multiple emlx files are present, so if we select folder Gmail , how will I be able to convert all emlx files to pst ??
You will have to use your own C# logic to get all the emlx files. You can search for such files in a folder and sub-folder using similar sample code as shown here. This will give you a list of file paths to all the emlx files. Then, you can load the EMLx files into MailMessage one by one and convert these to MapiMessage for adding to PST. I hope this will be helpful to you for achieving what you are looking for.