/// <summary> /// Clear all controls /// </summary> public void ClearView() { _mailStoreContent = null; _mailStoreExtractor = null; _metadataListView.Items.Clear(); _foldersTreeView.Nodes.Clear(); _messageCountLabel.Text = "0"; _fileIdLabel.Text = ""; _classificationLabel.Text = ""; _idMatchTypeLabel.Text = ""; _textSourceLabel.Text = ""; _contentResultLabel.Text = ""; _errorMessageLabel.Text = ""; _sha1BinaryHashLabel.Text = ""; _sha1ContentHashLabel.Text = ""; _fileEntropyLabel.Text = ""; _isEncryptedLabel.Text = ""; }
/// <summary> /// Displays mail store content. /// </summary> /// <param name="docContent"></param> /// <param name="extractor"></param> public void UpdateContentView(MailStoreContent docContent, IMailStoreExtractor extractor, string filename, long filelength) { try { ClearView(); _mailStoreContent = docContent; _extractAllEmailsButton.Enabled = true; if (_saveWithMailStoreFolderStructureCheckBox.Checked) { switch (_mailStoreContent.FormatId.ID) { case Id.OutlookPSTAnsi: case Id.OutlookPSTUnicode: case Id.OutlookOST2013Unicode: case Id.OutlookOSTAnsi: case Id.OutlookOSTUnicode: _saveWithMailStoreFolderStructureCheckBox.Enabled = true; break; default: _saveWithMailStoreFolderStructureCheckBox.Checked = false; _saveWithMailStoreFolderStructureCheckBox.Enabled = false; break; } } _fileNameLabel.Text = filename; _fileSizeLabel.Text = string.Format("{0:###,###,###,###}", filelength); if (_mailStoreContent == null) { return; } _fileIdLabel.Text = _mailStoreContent.FormatId.ID.ToString(); _classificationLabel.Text = _mailStoreContent.FormatId.Classification.ToString(); _idMatchTypeLabel.Text = _mailStoreContent.FormatId.MatchType.ToString(); _textSourceLabel.Text = _mailStoreContent.TextSourceType.ToString(); _contentResultLabel.Text = _mailStoreContent.Result.ToString(); _errorMessageLabel.Text = _mailStoreContent.ErrorMessage != null ? _mailStoreContent.ErrorMessage : ""; _sha1BinaryHashLabel.Text = _mailStoreContent.SHA1BinaryHash != null ? _mailStoreContent.SHA1BinaryHash : ""; _sha1ContentHashLabel.Text = _mailStoreContent.SHA1ContentHash != null ? _mailStoreContent.SHA1ContentHash : ""; _fileEntropyLabel.Text = _mailStoreContent.FileEntropy != null?_mailStoreContent.FileEntropy.Value.ToString("F7") : ""; _isEncryptedLabel.Text = _mailStoreContent.FormatId.IsEncrypted.ToString(); _mailStoreExtractor = extractor; _messageCountLabel.Text = _mailStoreContent.MessageCount.ToString(); // // Set metadata: // if (_mailStoreContent.Metadata.Count > 0) { MetadataHelper.PopulateListViewWithMetadata(_metadataListView, _mailStoreContent.Metadata); } // // Set folders (note: not all mail stores (e.g., MBOX) have internally stored email folders): // if (_mailStoreContent.Root != null) { SetFolders(_mailStoreContent.Root, _foldersTreeView); if (_foldersTreeView.Nodes.Count > 0) { _foldersTreeView.ExpandAll(); _foldersTreeView.SelectedNode = _foldersTreeView.Nodes[0]; } } } catch (Exception ex) { _hostUI.LogMessage("Error in MailStoreView.UpdateContentView: " + ex.Message); } }
public MailStoreExtractorHelper(MailStoreContent mailStoreContent, IMailStoreExtractor mailStoreExtractor, IHostUI messageLogger) { _mailStoreContent = mailStoreContent; _mailStoreExtractor = mailStoreExtractor; _messageLogger = messageLogger; }