make the worker asynchronously
This commit is contained in:
parent
9fdbb01bcd
commit
ea64977098
|
@ -1,7 +1,14 @@
|
|||
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 = "";
|
||||
}
|
||||
|
||||
// Extract
|
||||
var worker = new Worker(this);
|
||||
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
|
||||
// Run the worker
|
||||
(new Worker(this)).Run();
|
||||
}
|
||||
|
||||
public string OpenFileDialog()
|
||||
|
@ -93,12 +88,32 @@ namespace Catswords.DataType.Client
|
|||
|
||||
public void AddIndicator(DateTime dt, string Description, int ImageIndex)
|
||||
{
|
||||
listView1.Items.Add(new ListViewItem(new string[] { dt.ToString(), Description }, ImageIndex));
|
||||
if (listView1.InvokeRequired) {
|
||||
listView1.Invoke(new MethodInvoker(delegate
|
||||
{
|
||||
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)
|
||||
{
|
||||
textBox1.Text = status;
|
||||
if (textBox1.InvokeRequired)
|
||||
{
|
||||
textBox1.Invoke(new MethodInvoker(delegate
|
||||
{
|
||||
textBox1.Text = status;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
textBox1.Text = status;
|
||||
}
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using Catswords.DataType.Client.Helper;
|
||||
using Catswords.DataType.Client.Model;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Catswords.DataType.Client
|
||||
{
|
||||
|
@ -138,5 +139,17 @@ namespace Catswords.DataType.Client
|
|||
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