Removed unnecessary. Add summaryt for AddGrid Item. Add ClearGrid and ExecuteOnUIThread.
This commit is contained in:
parent
d591ec7f69
commit
2d91474002
1 changed files with 25 additions and 21 deletions
|
|
@ -3,34 +3,18 @@ using Observatory.Framework.Files;
|
||||||
using Observatory.Framework.Interfaces;
|
using Observatory.Framework.Interfaces;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace Observatory.PluginManagement
|
namespace Observatory.PluginManagement
|
||||||
{
|
{
|
||||||
public class PluginCore : IObservatoryCore
|
public class PluginCore : IObservatoryCore
|
||||||
{
|
{
|
||||||
|
|
||||||
public string Version => "1.0a";
|
public string Version => System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
|
||||||
|
|
||||||
public Status GetStatus()
|
public Status GetStatus()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestAllJournals()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RequestJournalRange(DateTime start, DateTime end)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RequestJournalRange(int startIndex, int number, bool newestFirst)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SendNotification(string title, string text)
|
public void SendNotification(string title, string text)
|
||||||
{
|
{
|
||||||
if (!LogMonitor.GetInstance.ReadAllInProgress())
|
if (!LogMonitor.GetInstance.ReadAllInProgress())
|
||||||
|
|
@ -54,6 +38,11 @@ namespace Observatory.PluginManagement
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds an item to the datagrid on UI thread to ensure visual update.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="worker"></param>
|
||||||
|
/// <param name="item"></param>
|
||||||
public void AddGridItem(IObservatoryWorker worker, object item)
|
public void AddGridItem(IObservatoryWorker worker, object item)
|
||||||
{
|
{
|
||||||
Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
|
Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
|
|
@ -81,6 +70,21 @@ namespace Observatory.PluginManagement
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearGrid(IObservatoryWorker worker, object templateItem)
|
||||||
|
{
|
||||||
|
Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
worker.PluginUI.DataGrid.Add(templateItem);
|
||||||
|
while (worker.PluginUI.DataGrid.Count > 1)
|
||||||
|
worker.PluginUI.DataGrid.RemoveAt(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ExecuteOnUIThread(Action action)
|
||||||
|
{
|
||||||
|
Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(action);
|
||||||
|
}
|
||||||
|
|
||||||
public event EventHandler<NotificationEventArgs> Notification;
|
public event EventHandler<NotificationEventArgs> Notification;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue