make the worker asynchronously
This commit is contained in:
parent
9fdbb01bcd
commit
ea64977098
|
@ -1,7 +1,14 @@
|
||||||
namespace Catswords.DataType.Client.Helper
|
namespace Catswords.DataType.Client.Helper
|
||||||
{
|
{
|
||||||
internal class CbpfExtractor
|
public class CbpfExtractor
|
||||||
{
|
{
|
||||||
|
private string FilePath;
|
||||||
|
|
||||||
|
public CbpfExtractor(string filePath)
|
||||||
|
{
|
||||||
|
FilePath = filePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,13 +66,8 @@ namespace Catswords.DataType.Client
|
||||||
FileName = "";
|
FileName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract
|
// Run the worker
|
||||||
var worker = new Worker(this);
|
(new Worker(this)).Run();
|
||||||
worker.FromFileExtension(); // Get data from file extension database
|
|
||||||
worker.FromAndroidManifest(); // Get data from Android manifest
|
|
||||||
worker.FromTimeline(); // Get data from timeline
|
|
||||||
worker.FromLinks(); // Get links from file
|
|
||||||
worker.FromExif(); // Get EXIF tags from file
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string OpenFileDialog()
|
public string OpenFileDialog()
|
||||||
|
@ -92,13 +87,33 @@ namespace Catswords.DataType.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddIndicator(DateTime dt, string Description, int ImageIndex)
|
public void AddIndicator(DateTime dt, string Description, int ImageIndex)
|
||||||
|
{
|
||||||
|
if (listView1.InvokeRequired) {
|
||||||
|
listView1.Invoke(new MethodInvoker(delegate
|
||||||
{
|
{
|
||||||
listView1.Items.Add(new ListViewItem(new string[] { dt.ToString(), Description }, ImageIndex));
|
listView1.Items.Add(new ListViewItem(new string[] { dt.ToString(), Description }, ImageIndex));
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
listView1.Items.Add(new ListViewItem(new string[] { dt.ToString(), Description }, ImageIndex));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowStatus(string status)
|
public void ShowStatus(string status)
|
||||||
|
{
|
||||||
|
if (textBox1.InvokeRequired)
|
||||||
|
{
|
||||||
|
textBox1.Invoke(new MethodInvoker(delegate
|
||||||
{
|
{
|
||||||
textBox1.Text = status;
|
textBox1.Text = status;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textBox1.Text = status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using Catswords.DataType.Client.Helper;
|
using Catswords.DataType.Client.Helper;
|
||||||
using Catswords.DataType.Client.Model;
|
using Catswords.DataType.Client.Model;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Catswords.DataType.Client
|
namespace Catswords.DataType.Client
|
||||||
{
|
{
|
||||||
|
@ -138,5 +139,17 @@ namespace Catswords.DataType.Client
|
||||||
Parent.AddIndicator(DateTime.Now, $"{tag.Name} ({tag.Section}): {tag.Description}", 5);
|
Parent.AddIndicator(DateTime.Now, $"{tag.Name} ({tag.Section}): {tag.Description}", 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Run()
|
||||||
|
{
|
||||||
|
new Task(() =>
|
||||||
|
{
|
||||||
|
FromFileExtension(); // Get data from file extension database
|
||||||
|
FromAndroidManifest(); // Get data from Android manifest
|
||||||
|
FromTimeline(); // Get data from timeline
|
||||||
|
FromLinks(); // Get links from file
|
||||||
|
FromExif(); // Get EXIF tags from file
|
||||||
|
}).Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user