private void lvAttachments_ItemDoubleClick(
     object sender,
     ItemDoubleClickEventArgs e)
 {
     if (lvAttachments.SelectedItems.Count <= 0)
     {
         return;
     }
     UltraListViewItem selected = lvAttachments.SelectedItems[0];
     try
     {
         string selectedFilePath = selected.Tag.ToString();
         string extension = Strings.Replace
             (
                 Path.GetExtension(selectedFilePath),
                 ".",
                 "");
         GetSetFileType
             (
                 extension,
                 selectedFilePath);
     }
     catch (Exception)
     {
         if (sender.GetType() == typeof (UltraListView))
         {
             var aPricture = new FrmPricture((UltraListView) sender);
             aPricture.Show();
         }
     }
 }
 private void GetSetFileType(
     string extension,
     string selectedFilePath)
 {
     if (!IsImageFile.IsRecognisedImageFile(selectedFilePath))
     {
         FrmExcel aFrmExcel;
         FrmWord aFrmWord;
         switch (extension)
         {
             case "xlsx":
                 aFrmExcel = new FrmExcel(selectedFilePath);
                 aFrmExcel.Show();
                 break;
             case "xla":
                 aFrmExcel = new FrmExcel(selectedFilePath);
                 aFrmExcel.Show();
                 break;
             case "xls":
                 aFrmExcel = new FrmExcel(selectedFilePath);
                 aFrmExcel.Show();
                 break;
             case "xlam":
                 aFrmExcel = new FrmExcel(selectedFilePath);
                 aFrmExcel.Show();
                 break;
             case "doc":
                 aFrmWord = new FrmWord(selectedFilePath);
                 aFrmWord.Show();
                 break;
             case "docx":
                 aFrmWord = new FrmWord(selectedFilePath);
                 aFrmWord.Show();
                 break;
             case "txt":
                 aFrmWord = new FrmWord(selectedFilePath);
                 aFrmWord.Show();
                 break;
             case "rtf":
                 aFrmWord = new FrmWord(selectedFilePath);
                 aFrmWord.Show();
                 break;
         }
     }
     else
     {
         var aPricture = new FrmPricture(selectedFilePath);
         aPricture.Show();
     }
 }