AOT Builds
This commit is contained in:
39
Shared/Models/Stateless/Methods/IId.cs
Normal file
39
Shared/Models/Stateless/Methods/IId.cs
Normal file
@ -0,0 +1,39 @@
|
||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
public interface IId
|
||||
{
|
||||
|
||||
bool TestStatic_NameWithoutExtensionIsIdFormat(string fileNameWithoutExtension) =>
|
||||
NameWithoutExtensionIsIdFormat(fileNameWithoutExtension);
|
||||
static bool NameWithoutExtensionIsIdFormat(string fileNameWithoutExtension) =>
|
||||
Id.NameWithoutExtensionIsIdFormat(fileNameWithoutExtension);
|
||||
|
||||
bool TestStatic_NameWithoutExtensionIsIdFormat(FileHolder fileHolder) =>
|
||||
NameWithoutExtensionIsIdFormat(fileHolder);
|
||||
static bool NameWithoutExtensionIsIdFormat(FileHolder fileHolder) =>
|
||||
NameWithoutExtensionIsIdFormat(fileHolder.NameWithoutExtension);
|
||||
|
||||
string TestStatic_GetPaddedId(int intMinValueLength, int index, int id) =>
|
||||
GetPaddedId(intMinValueLength, index, id);
|
||||
static string GetPaddedId(int intMinValueLength, int index, int id) =>
|
||||
id > -1 ? $"{index}070{id.ToString().PadLeft(intMinValueLength, '0')}" : $"{index}030{id.ToString()[1..].PadLeft(intMinValueLength, '0')}";
|
||||
|
||||
bool TestStatic_NameWithoutExtensionIsPaddedIdFormat(string fileNameWithoutExtension, int sortOrderOnlyLengthIndex) =>
|
||||
NameWithoutExtensionIsPaddedIdFormat(fileNameWithoutExtension, sortOrderOnlyLengthIndex);
|
||||
static bool NameWithoutExtensionIsPaddedIdFormat(string fileNameWithoutExtension, int sortOrderOnlyLengthIndex) =>
|
||||
fileNameWithoutExtension.Length > sortOrderOnlyLengthIndex
|
||||
&& fileNameWithoutExtension[sortOrderOnlyLengthIndex] == '0'
|
||||
&& fileNameWithoutExtension[sortOrderOnlyLengthIndex - 3] == '0'
|
||||
&& fileNameWithoutExtension.All(l => char.IsNumber(l));
|
||||
|
||||
short TestStatic_GetSortOrderOnlyLengthIndex(int offset) =>
|
||||
GetSortOrderOnlyLengthIndex(offset);
|
||||
static short GetSortOrderOnlyLengthIndex(int offset) =>
|
||||
(short)(offset.ToString().Length + 3);
|
||||
|
||||
bool TestStatic_NameWithoutExtensionIsPaddedIdFormat(FileHolder fileHolder, int sortOrderOnlyLengthIndex) =>
|
||||
NameWithoutExtensionIsPaddedIdFormat(fileHolder, sortOrderOnlyLengthIndex);
|
||||
static bool NameWithoutExtensionIsPaddedIdFormat(FileHolder fileHolder, int sortOrderOnlyLengthIndex) =>
|
||||
NameWithoutExtensionIsPaddedIdFormat(fileHolder.NameWithoutExtension, sortOrderOnlyLengthIndex);
|
||||
|
||||
}
|
Reference in New Issue
Block a user