5.2 KiB
5.2 KiB
Events
Base event
Every event inherits from the base event, so these properties and methods are always available
public abstract class HopFrameEventArgs {
public TSender Sender { get; }
public bool IsCanceled { get; }
public TableConfig Table { get; }
public void SetCancelled(bool canceled);
}
Properties:
- Sender: The sender of the event.
- Type:
TSender
- Type:
- IsCanceled: Indicates whether the event is canceled.
- Type:
bool
- Type:
- Table: The table configuration related to the event.
- Type:
TableConfig
- Type:
Methods:
- SetCancelled
- Parameters:
canceled: A boolean value to set the cancellation state.
- Returns:
void
- Parameters:
DeleteEntryEvent
Event arguments for a delete entry event.
public sealed class DeleteEntryEvent : HopFrameEventArgs {
public object Entity { get; }
}
Properties:
- Entity: The entity being deleted.
- Type:
object
- Type:
CreateEntryEvent
Event arguments for a create entry event.
public sealed class CreateEntryEvent : HopFrameEventArgs {
}
UpdateEntryEvent
Event arguments for an update entry event.
public sealed class UpdateEntryEvent : HopFrameEventArgs {
public object Entity { get; }
}
Properties:
- Entity: The entity being updated.
- Type:
object
- Type:
SelectEntryEvent
Event arguments for a select entry event.
public sealed class SelectEntryEvent : HopFrameEventArgs {
public object Entity { get; }
public bool Selected { get; set; }
}
Properties:
- Entity: The entity being selected.
- Type:
object
- Type:
- Selected: Indicates whether the entity is selected.
- Type:
bool
- Type:
PageChangeEvent
Event arguments for a page change event.
public sealed class PageChangeEvent : HopFrameEventArgs {
public int CurrentPage { get; }
public int TotalPages { get; }
public int NewPage { get; set; }
}
Properties:
- CurrentPage: The current page number.
- Type:
int
- Type:
- TotalPages: The total number of pages.
- Type:
int
- Type:
- NewPage: The new page number to navigate to.
- Type:
int
- Type:
ReloadEvent
Event arguments for a reload event.
public sealed class ReloadEvent : HopFrameEventArgs {
}
SearchEvent
Event arguments for a search event.
public sealed class SearchEvent : HopFrameEventArgs {
public string SearchTerm { get; set; }
public int CurrentPage { get; }
public void SetSearchResult(IEnumerable result, int totalPages);
}
Properties:
- SearchTerm: The search term used.
- Type:
string
- Type:
- CurrentPage: The current page number.
- Type:
int
- Type:
- SearchResult: The search results.
- Type:
IEnumerable<object>?
- Type:
- TotalPages: The total number of pages of search results.
- Type:
int
- Type:
Methods:
- SetSearchResult
- Parameters:
result: The current page of search results.totalPages: The total pages of search results.
- Returns:
void
- Parameters:
TableInitializedEvent
Event arguments for a table initialization event.
public class TableInitializedEvent : HopFrameEventArgs {
public List<PluginButton> PluginButtons { get; };
public DefaultButtonToggles DefaultButtons { get; set; };
public void AddPageButton(string title, Func<Task> callback, bool pushRight = false, IconInfo? icon = null);
public void AddPageButton(string title, Action callback, bool pushRight = false, IconInfo? icon = null);
public void AddPageButton<TEntity>(string title, Func<Task> callback, bool pushRight = false, IconInfo? icon = null);
public void AddPageButton<TEntity>(string title, Action callback, bool pushRight = false, IconInfo? icon = null);
public void AddEntityButton(IconInfo icon, Func<object, TableConfig, Task> callback);
public void AddEntityButton(IconInfo icon, Action<object, TableConfig> callback);
public void AddEntityButton<TEntity>(IconInfo icon, Func<TEntity, TableConfig, Task> callback);
public void AddEntityButton<TEntity>(IconInfo icon, Action<TEntity, TableConfig> callback);
}
Properties:
- PluginButtons: The list of plugin buttons for the table.
- Type:
List<PluginButton>
- Type:
- DefaultButtons: The default button toggles for the table.
- Type:
DefaultButtonToggles
- Type:
Methods:
-
AddPageButton
- Parameters:
title: The title of the button.callback: The callback function for the button.pushRight: Indicates whether to push the button to the right. (default:false)icon: The icon for the button. (default:null)
- Returns:
void
- Parameters:
-
AddEntityButton
- Parameters:
icon: The icon for the button.callback: The callback function for the button.
- Returns:
void
- Parameters:
ValidationEvent
Event arguments for a validation event.
public sealed class ValidationEvent : HopFrameEventArgs {
public IList<string> Errors { get; }
public PropertyConfig Property { get; }
}
Properties:
- Errors: The list of validation errors.
- Type:
IList<string>
- Type:
- Property: The property being validated.
- Type:
PropertyConfig
- Type: