2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00
This commit is contained in:
2024-06-21 16:37:48 +03:00
parent c04fc29810
commit 3a89a108db
49 changed files with 2095 additions and 1373 deletions

View File

@ -0,0 +1,25 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.Text;
namespace Esiur.Net.Packets
{
public static class IIPAuthExtensions
{
public static IIPAuthPacketIAuthFormat GetIAuthFormat(this object value)
{
if (value is string)
return IIPAuthPacketIAuthFormat.Text;
else if (value is int || value is uint
|| value is byte || value is sbyte
|| value is short || value is ushort
|| value is long || value is ulong)
return IIPAuthPacketIAuthFormat.Number;
else if (value.GetType().IsArray)
return IIPAuthPacketIAuthFormat.Choice;
throw new Exception("Unknown IAuth format");
}
}
}