2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 08:23:42 -04:00

New UI framework changes

This commit is contained in:
Xjph
2023-02-08 21:39:37 -03:30
parent e2c6816d45
commit 4dba621d7c
7 changed files with 141 additions and 203 deletions

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Observatory.Framework
{
public class BasicGrid
{
public BasicGrid()
{
Headers = new();
Formats = new();
Items = new();
}
public readonly ObservableCollection<string> Headers;
public readonly ObservableCollection<string> Formats;
public readonly ObservableCollection<ObservableCollection<object>> Items;
}
}

View File

@ -154,7 +154,7 @@ namespace Observatory.Framework.Interfaces
/// </summary>
/// <param name="worker">Reference to the calling plugin's worker interface.</param>
/// <param name="item">Grid item to be added. Object type should match original template item used to create the grid.</param>
public void AddGridItem(IObservatoryWorker worker, object item);
public void AddGridItem(IObservatoryWorker worker, List<object> item);
/// <summary>
/// Add multiple items to the bottom of the basic UI grid.
@ -167,8 +167,7 @@ namespace Observatory.Framework.Interfaces
/// Clears basic UI grid, removing all items.
/// </summary>
/// <param name="worker">Reference to the calling plugin's worker interface.</param>
/// <param name="templateItem">Template item used to re-initialise the grid.</param>
public void ClearGrid(IObservatoryWorker worker, object templateItem);
public void ClearGrid(IObservatoryWorker worker);
/// <summary>
/// Requests current Elite Dangerous status.json content.

View File

@ -1439,26 +1439,18 @@
<param name="notificationId">Guid of notification to be updated.</param>
<param name="notificationEventArgs">NotificationArgs object specifying updated notification content and behaviour.</param>
</member>
<member name="M:Observatory.Framework.Interfaces.IObservatoryCore.AddGridItem(Observatory.Framework.Interfaces.IObservatoryWorker,System.Object)">
<member name="M:Observatory.Framework.Interfaces.IObservatoryCore.AddGridItem(Observatory.Framework.Interfaces.IObservatoryWorker,System.Collections.Generic.List{System.Object})">
<summary>
Add an item to the bottom of the basic UI grid.
</summary>
<param name="worker">Reference to the calling plugin's worker interface.</param>
<param name="item">Grid item to be added. Object type should match original template item used to create the grid.</param>
</member>
<member name="M:Observatory.Framework.Interfaces.IObservatoryCore.AddGridItems(Observatory.Framework.Interfaces.IObservatoryWorker,System.Collections.Generic.IEnumerable{System.Object})">
<summary>
Add multiple items to the bottom of the basic UI grid.
</summary>
<param name="worker">Reference to the calling plugin's worker interface.</param>
<param name="items">Grid items to be added. Object types should match original template item used to create the grid.</param>
</member>
<member name="M:Observatory.Framework.Interfaces.IObservatoryCore.ClearGrid(Observatory.Framework.Interfaces.IObservatoryWorker,System.Object)">
<member name="M:Observatory.Framework.Interfaces.IObservatoryCore.ClearGrid(Observatory.Framework.Interfaces.IObservatoryWorker)">
<summary>
Clears basic UI grid, removing all items.
</summary>
<param name="worker">Reference to the calling plugin's worker interface.</param>
<param name="templateItem">Template item used to re-initialise the grid.</param>
</member>
<member name="M:Observatory.Framework.Interfaces.IObservatoryCore.GetStatus">
<summary>
@ -1520,13 +1512,12 @@
<para>(Untested/not implemented)</para>
</summary>
</member>
<member name="F:Observatory.Framework.PluginUI.DataGrid">
<member name="F:Observatory.Framework.PluginUI.BasicGrid">
<summary>
<para>Collection bound to DataGrid used byu plugins with UIType.Basic.</para>
<para>Objects in collection should be of a class defined within the plugin consisting of string properties.<br/>Each object is a single row, and the property names are used as column headers.</para>
<para>>Two-dimensional collection of items to display in UI grid for UIType.Basic</para>
</summary>
</member>
<member name="M:Observatory.Framework.PluginUI.#ctor(System.Collections.ObjectModel.ObservableCollection{System.Object})">
<member name="M:Observatory.Framework.PluginUI.#ctor(Observatory.Framework.BasicGrid)">
<summary>
Instantiate PluginUI of UIType.Basic.
</summary>

View File

@ -23,25 +23,9 @@ namespace Observatory.Framework
public object UI;
/// <summary>
/// <para>Collection bound to DataGrid used by plugins with UIType.Basic.</para>
/// <para>Objects in collection should be of a class defined within the plugin consisting of string properties.<br/>Each object is a single row, and the property names are used as column headers.</para>
/// <para>>Two-dimensional collection of items to display in UI grid for UIType.Basic</para>
/// </summary>
public ObservableCollection<object> DataGrid;
/// <summary>
/// <para>Collection bound to DataGrid headers used by plugins with UIType.Basic.</para>
/// </summary>
public ObservableCollection<string> Headers;
/// <summary>
/// <para>Collection used to specify formatting of items in respective columns.</para>
/// </summary>
public ObservableCollection<string> Formats;
/// <summary>
/// <para>Two-dimensional collection of items to display in UI grid.</para>
/// </summary>
public ObservableCollection<ObservableCollection<object>> Items;
public BasicGrid BasicGrid;
/// <summary>
/// Instantiate PluginUI of UIType.Basic.
@ -50,10 +34,10 @@ namespace Observatory.Framework
/// <para>Collection bound to DataGrid used byu plugins with UIType.Basic.</para>
/// <para>Objects in collection should be of a class defined within the plugin consisting of string properties.<br/>Each object is a single row, and the property names are used as column headers.</para>
/// </param>
public PluginUI(ObservableCollection<object> DataGrid)
public PluginUI(BasicGrid basicGrid)
{
PluginUIType = UIType.Basic;
this.DataGrid = DataGrid;
BasicGrid = basicGrid;
}
/// <summary>