//ExEnd:SourceEmailFilePath

            /// <summary>
            /// Gets email file's metadata
            /// </summary>
            public static void GetEmailMetadata()
            {
                try
                {
                    //ExStart:GetEmailMessageMetadata
                    // initialize EmlFormat
                    EmlFormat emlFormat = new EmlFormat(Common.MapSourceFilePath(filePath));
                    // get metadata
                    EmlMetadata metadata = emlFormat.GetEmlInfo();

                    // display metadata
                    Console.WriteLine("CC: " + metadata.CC);
                    Console.WriteLine("Mail Address From: " + metadata.MailAddressFrom);
                    Console.WriteLine("Subject: " + metadata.Subject);
                    Console.WriteLine("Attachments: " + metadata.Attachments[0]);
                    //ExEnd:GetEmailMessageMetadata
                }
                catch (Exception exp)
                {
                    Console.WriteLine(exp.Message);
                }
            }
            //ExEnd:SourceEmailFilePath

            /// <summary>
            /// Gets email file's metadata
            /// </summary>
            public static void GetEmailMetadata()
            {
                try
                {
                    //ExStart:GetEmailMessageMetadata
                    // initialize EmlFormat 
                    EmlFormat emlFormat = new EmlFormat(Common.MapSourceFilePath(filePath));
                    // get metadata
                    EmlMetadata metadata = emlFormat.GetEmlInfo();

                    // display metadata
                    Console.WriteLine("CC: " + metadata.CC);
                    Console.WriteLine("Mail Address From: " + metadata.MailAddressFrom);
                    Console.WriteLine("Subject: " + metadata.Subject);
                    Console.WriteLine("Attachments: " + metadata.Attachments[0]);
                    //ExEnd:GetEmailMessageMetadata
                }
                catch (Exception exp)
                {
                    Console.WriteLine(exp.Message);
                }
            }
        public JsonResult <List <PropertyItem> > Get(string file)
        {
            try
            {
                FileStream        original          = File.Open(Utils._storagePath + "\\" + file, FileMode.OpenOrCreate);
                FileFormatChecker fileFormatChecker = new FileFormatChecker(original);

                DocumentType        documentType = fileFormatChecker.GetDocumentType();
                List <PropertyItem> values       = new List <PropertyItem>();

                if (fileFormatChecker.VerifyFormat(documentType))
                {
                    switch (documentType)
                    {
                    case DocumentType.Doc:

                        DocFormat docFormat = new DocFormat(original);
                        values = AppendMetadata(docFormat.GetMetadata(), values);

                        break;

                    case DocumentType.Xls:

                        XlsFormat xlsFormat = new XlsFormat(original);
                        values = AppendMetadata(xlsFormat.GetMetadata(), values);

                        break;

                    case DocumentType.Pdf:

                        PdfFormat pdfFormat = new PdfFormat(original);
                        values = AppendMetadata(pdfFormat.GetMetadata(), values);
                        values = AppendXMPData(pdfFormat.GetXmpData(), values);

                        break;

                    case DocumentType.Png:

                        PngFormat pngFormat = new PngFormat(original);
                        values = AppendMetadata(pngFormat.GetMetadata(), values);
                        values = AppendXMPData(pngFormat.GetXmpData(), values);

                        break;

                    case DocumentType.Jpeg:

                        JpegFormat jpegFormat = new JpegFormat(original);
                        values = AppendMetadata(jpegFormat.GetMetadata(), values);
                        values = AppendXMPData(jpegFormat.GetXmpData(), values);

                        break;

                    case DocumentType.Gif:

                        GifFormat gifFormat = new GifFormat(original);
                        values = AppendMetadata(gifFormat.GetMetadata(), values);
                        values = AppendXMPData(gifFormat.GetXmpData(), values);

                        break;

                    case DocumentType.Bmp:

                        BmpFormat bmpFormat = new BmpFormat(original);
                        values = AppendMetadata(bmpFormat.GetMetadata(), values);

                        break;

                    case DocumentType.Msg:

                        OutlookMessage outlookMessage = new OutlookMessage(original);
                        values = AppendMetadata(outlookMessage.GetMsgInfo(), values);
                        break;

                    case DocumentType.Eml:

                        EmlFormat emlFormat = new EmlFormat(original);
                        values = AppendMetadata(emlFormat.GetEmlInfo(), values);
                        break;

                    case DocumentType.Dwg:

                        DwgFormat dwgFormat = new DwgFormat(original);
                        values = AppendMetadata(dwgFormat.GetMetadata(), values);
                        break;

                    case DocumentType.Dxf:

                        DxfFormat dxfFormat = new DxfFormat(original);
                        values = AppendMetadata(dxfFormat.GetMetadata(), values);
                        break;

                    default:

                        DocFormat defaultDocFormat = new DocFormat(original);
                        values = AppendMetadata(defaultDocFormat.GetMetadata(), values);

                        break;
                    }

                    return(Json(values));
                }
                else
                {
                    throw new Exception("File format not supported.");
                }
            }
            catch (Exception exc)
            {
                throw exc;
            }
        }