mirror of
https://github.com/XFox111/SimpleOTP.git
synced 2026-04-22 08:00:45 +03:00
Updated OTPFactory (markdown)
+38
-1
@@ -1 +1,38 @@
|
|||||||
TODO
|
Namespace: `SimpleOTP`
|
||||||
|
|
||||||
|
Assembly: `SimpleOTP.dll`
|
||||||
|
|
||||||
|
Class used to streamline OTP code generation on client devices.
|
||||||
|
```csharp
|
||||||
|
public class OTPFactory : INotifyPropertyChanged, IDisposable
|
||||||
|
```
|
||||||
|
Inheritance: [INotifyPropertyChanged](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=net-5.0), [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable?view=net-5.0)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
| Constructor | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| [OTPFactory(OTPConfiguration, int)](https://github.com/XFox111/SimpleOTP/wiki/OTPCode.OTPCode) | Initializes a new instance of the `OTPFactory` class. |
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
| Property | Type | Accessor | Description |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| `CurrentCode` | [OTPCode](https://github.com/XFox111/SimpleOTP/wiki/OTPCode) | get/set | Gets or sets current valid OTP code instance. |
|
||||||
|
| `Configuration` | [OTPConfiguration](https://github.com/XFox111/SimpleOTP/wiki/OTPConfiguration) | get/set | Gets or sets OTP configuration of the current instance. |
|
||||||
|
| `TimeLeft` | [TimeSpan?](https://docs.microsoft.com/en-us/dotnet/api/system.timespan?view=net-5.0) | get/set | Gets time left before current OTP code expires. |
|
||||||
|
|
||||||
|
## Events
|
||||||
|
| Event | EventType | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `CodeUpdated` | [OTPCodeUpdatedEventHandler](https://github.com/XFox111/SimpleOTP/wiki/OTPCodeUpdatedEventHandler) | Event is fired when new OTP code is generated. |
|
||||||
|
| `PropertyChanged` | [PropertyChangedEventHandler](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.propertychangedeventhandler?view=net-5.0) | Occurs when a property value changes. |
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
| Method | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?view=net-5.0#System_IDisposable_Dispose) | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.<br/>(Inherited from [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable?view=net-5.0#events)) |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
```csharp
|
||||||
|
var factory = new (config);
|
||||||
|
factory.CodeUpdated += (newCode) => Console.WriteLine(newCode.Code);
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user