Class PropertyAccessTracker<T>
Tracks property accesses on instances of type T.
Inherited Members
Namespace: Coree.NETASP.UnderConstruction
Assembly: Coree.NETASP.dll
Syntax
public class PropertyAccessTracker<T> where T : class, new()
Type Parameters
Name | Description |
---|---|
T | The type of the tracked instance, must be a class with virtual properties. |
Constructors
| Edit this page View SourcePropertyAccessTracker()
Initializes a new instance of the PropertyAccessTracker.
Declaration
public PropertyAccessTracker()
Properties
| Edit this page View SourceInstance
Gets the instance of the tracked object.
Declaration
public T Instance { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Edit this page View SourceHasPropertyBeenAccessed(string)
Checks if a property has been accessed.
Declaration
public bool HasPropertyBeenAccessed(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | The name of the property to check. |
Returns
Type | Description |
---|---|
bool | True if the property has been accessed; otherwise, false. |
OnPropertyAccessed(string)
Called when a property is accessed.
Declaration
public void OnPropertyAccessed(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | The name of the accessed property. |
Remarks
This method updates the tracking dictionary and logs the access.