diff --git a/Documentation/Documentation.md b/Documentation/Documentation.md new file mode 100644 index 0000000..3dc13e6 --- /dev/null +++ b/Documentation/Documentation.md @@ -0,0 +1,96 @@ +# Documentation for our Inventory page + + +

+##First part : The inventory grid (InventoryItem.razor.cs file) +

+ + +### internal void OnDragEnter() +#### Summary: +This method will create an action when the user will put an item in the grid. +
+ +### internal void OnDragEnter() +#### Summary: +This method will create an action when the user will remove an item of the grid. +
+ +### internal void OnDrop() +#### Summary: +This method will create an action when the user will put an item in onother one on the grid. +
+ +### internal void OnDragEnd() +#### Summary: +This method will create an action when the user will drag and drop an item in the grid. +
+ +### private void OnDragStart() +#### Summary: +This method will create an action when the user will start the drag and drop of an item in the grid. +
+ + +

+##Second part : The inventory grid (MyInventory.razor.cs file) +

+ + +### public MyInventory() +#### Summary: +This method is the constructor of the component. It initializes the variables for the inventory grid part. +
+ +### private async void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) +#### Parameters: +- sender is the sender of the event +- e is the event +#### Summary: +This method is called when our collection 'Actions' is changed. +It will call the Js script, and if needed, the dataService. + + +

+##Last part : The items list +

+ + +### private async Task OnReadData(DataGridReadDataEventArgs e) +#### Parameters: +- e is the event +#### Summary: +This method will initialize a lot of variables used for the list. +
+ +### private List choseList() +#### Returns: +- a list of items corresponding to what we want +#### Summary: +This method will check if our search bar is empty. +If it is, it will set our Datagrid list to the default one: items +Else, it will take the texte in the Search bar, and search in all the items, those that correspond. +
+ +### private void inputValue() +#### Summary: +When we type something in the search bar, this method is called. +It will initialize the 'Filtered' list with the items corresponding to what we are typing. +Then, it will call the choseList() method. +
+ +### private void OnPress() +#### Summary: +This method will be called when we will press the 'Sort' button. +It will set a boolean either to true if the list isn't already sorted, or to false if it is. +Then, it will call the SortList() method. +
+ +### private List SortList() +#### Returns: +- a list of items corresponding to what we want +#### Summary: +This method will check if our isSorted boolean is false or true. +If it's false, then it will set our list to the default one: the items won't be sorted. +Else, it will set it with another list, that we sort by name. +
\ No newline at end of file diff --git a/myBlazorApp/myBlazorApp/Components/InventoryItem.razor.cs b/myBlazorApp/myBlazorApp/Components/InventoryItem.razor.cs index bbb5d8f..060eafe 100644 --- a/myBlazorApp/myBlazorApp/Components/InventoryItem.razor.cs +++ b/myBlazorApp/myBlazorApp/Components/InventoryItem.razor.cs @@ -82,7 +82,7 @@ public partial class InventoryItem } /// - /// Creating a new action when the user leaves an item of the Inventory items + /// Creating a new action when the user removes an item of the Inventory items /// internal void OnDragLeave() { @@ -94,7 +94,7 @@ public partial class InventoryItem } /// - /// Creating a new action when the user drops an item in an Inventory item in the Invnetory item + /// Creating a new action when the user drops an item in an Inventory item /// internal void OnDrop() {