Skip to content

Commit

Permalink
Search messages missing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvadev committed Dec 13, 2022
1 parent f325d6a commit aeaf019
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/XstReader.Api/XstMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ public override string DisplayName
[Description(@"Contains a list of carbon copy (Cc) recipient display names.")]
public virtual string Cc => Properties[PropertyCanonicalName.PidTagDisplayCc]?.ValueAsStringSanitized;

/// <summary>
/// The Cc Summary of the Message
/// </summary>
[DisplayName("Display Bcc")]
[Category(@"Message Properties")]
[Description(@"Contains a list of clind carbon copy (Bcc) recipient display names.")]
public virtual string Bcc => Properties[PropertyCanonicalName.PidTagDisplayBcc]?.ValueAsStringSanitized;

/// <summary>
/// The To Summary of the Message
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/XstReader.Api/XstReader.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>XstReader</RootNamespace>
<Version>1.0.5</Version>
<AssemblyVersion>1.0.5</AssemblyVersion>
<FileVersion>1.0.5</FileVersion>
<Version>1.0.6</Version>
<AssemblyVersion>1.0.6</AssemblyVersion>
<FileVersion>1.0.6</FileVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>iluvadev</Authors>
Expand Down
56 changes: 54 additions & 2 deletions src/XstReader/Controls/XstMessageListControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions src/XstReader/Controls/XstMessageListControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public partial class XstMessageListControl : UserControl,
IXstDataSourcedControl<IEnumerable<XstMessage>>,
IXstElementSelectable<XstMessage>
{
private string _LastSearchedText = string.Empty;

public XstMessageListControl()
{
InitializeComponent();
Expand All @@ -31,8 +33,11 @@ private void Initialize()
ObjectListView.Columns.Add(new OLVColumn("Subject", nameof(XstMessage.Subject)) { WordWrap = true, FillsFreeSpace = true });
ObjectListView.Columns.Add(new OLVColumn("From", nameof(XstMessage.From)) { Width = 150 });
ObjectListView.Columns.Add(new OLVColumn("To", nameof(XstMessage.To)) { Width = 150 });
ObjectListView.Columns.Add(new OLVColumn("Cc", nameof(XstMessage.Cc)) { Width = 150 });
//ObjectListView.Columns.Add(new OLVColumn("Bcc", nameof(XstMessage.Bcc)) { Width = 150 });
ObjectListView.Columns.Add(new OLVColumn("Date", nameof(XstMessage.Date)) { Width = 150 });


ObjectListView.FormatRow += (s, e) =>
{
if (e.Item.RowObject is XstMessage message)
Expand All @@ -48,6 +53,30 @@ private void Initialize()
ObjectListView.ItemSelectionChanged += (s, e) => RaiseSelectedItemChanged();

SetDataSource(null);

SearchTextButton.Click += (s, e) =>
{
TimerSearchText.Stop();
_LastSearchedText = SearchTextBox.Text;
ObjectListView.ModelFilter = TextMatchFilter.Contains(ObjectListView, _LastSearchedText);
};
SearchTextCancelButton.Click += (s, e) =>
{
SearchTextBox.Clear();
SearchTextButton.PerformClick();
};
SearchTextBox.TextChanged += (s, e) =>
{
TimerSearchText.Start();
SearchTextCancelButton.Enabled = string.IsNullOrEmpty(SearchTextBox.Text) ? ButtonEnabled.False : ButtonEnabled.Container;
};

TimerSearchText.Tick += (s, e) =>
{
TimerSearchText.Stop();
if (SearchTextBox.Text != _LastSearchedText)
SearchTextButton.PerformClick();
};
}

protected override void OnLoad(EventArgs e)
Expand All @@ -68,6 +97,7 @@ protected override void OnLoad(EventArgs e)

public void SetDataSource(IEnumerable<XstMessage>? dataSource)
{
SearchTextBox.Clear();
_DataSource = dataSource;
ObjectListView.Objects = dataSource;
RaiseSelectedItemChanged();
Expand Down
3 changes: 3 additions & 0 deletions src/XstReader/Controls/XstMessageListControl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="TimerSearchText.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
30 changes: 30 additions & 0 deletions src/XstReader/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/XstReader/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
<data name="application_export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\application-export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="close_circle_outline_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\close-circle-outline_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cog" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cog.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down Expand Up @@ -232,6 +235,12 @@
<data name="link" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="magnify" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\magnify.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="magnify_18" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\magnify_18.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="microsoft_outlook" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\microsoft-outlook.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
Binary file added src/XstReader/Resources/close-circle-outline_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/XstReader/Resources/magnify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/XstReader/Resources/magnify_18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/XstReader/XstReader.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<RepositoryUrl>https://github.com/iluvadev/XstReader</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>pst-file-viewer;outlook</PackageTags>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
<AssemblyVersion>2.1.0</AssemblyVersion>
<FileVersion>2.1.0</FileVersion>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<PackageId>XstReader</PackageId>
<Version>2.2.0</Version>
Expand Down

0 comments on commit aeaf019

Please sign in to comment.