From 81c327198fdd447f31ca58f32bbeee205af8efd7 Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Tue, 1 Jun 2021 16:13:58 +0300 Subject: [PATCH] Updated OTPFactory (markdown) --- OTPFactory.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/OTPFactory.md b/OTPFactory.md index 30404ce..e728a50 100644 --- a/OTPFactory.md +++ b/OTPFactory.md @@ -1 +1,38 @@ -TODO \ No newline at end of file +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.
(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); +``` \ No newline at end of file