Merge pull request #1 from GoodBoyAlex/inwork

20210706
This commit is contained in:
Alexander 2021-07-07 07:15:30 +03:00 committed by GitHub
commit f40ec83545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 61 additions and 49 deletions

23
anbs_cp/LikeDelphi.cs Normal file
View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace anbs_cp
{
public class LikeDelphi
{
/*
* Аналог функции "IncludeTrailingBackslash
*/
public static string IncludeTrailingBackslash(string Path)
{
string result = Path;
int Index = Path.Length - 1;
if (Path[Index] != '\\')
{
result = $"{Path}\\";
}
return result;
}
}
}

View File

@ -1,10 +1,15 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace delphi2csharp
namespace anbs_componentspack
{
public enum TStringListType
{
sltStringsOnly, //Только строки -- сортировка по строкам включена, имеющиеся объекты удалит
sltObjectsOnly, //Только объекты -- сортировка по объектам включена
sltBoth //И строки, и объекты -- сортировка отключена
}
public class TStringList
{
private List<string> FLines;

26
anbs_cp/TypeConverter.cs Normal file
View File

@ -0,0 +1,26 @@
using System;
namespace anbs_componentspack
{
public static class TypeConverter
{
public static string IntToStr(int AInt) => AInt.ToString();
public static string IntToStr(long AInt) => AInt.ToString();
public static int StrToInt(string AStr)
{
if (!int.TryParse(AStr, out int result))
{
result = 0;
}
return result;
}
public static long StrToInt64(string AStr)
{
if (!long.TryParse(AStr, out long result))
{
result = 0;
}
return result;
}
}
}

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "delphi2csharp", "delphi2csharp\delphi2csharp.csproj", "{D722F27B-693F-471A-8166-8A7912531A4F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "anbs_cp", "anbs_cp\anbs_cp.csproj", "{442A56CC-1061-4EB5-8B67-3E3D997976D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -11,10 +11,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D722F27B-693F-471A-8166-8A7912531A4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D722F27B-693F-471A-8166-8A7912531A4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D722F27B-693F-471A-8166-8A7912531A4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D722F27B-693F-471A-8166-8A7912531A4F}.Release|Any CPU.Build.0 = Release|Any CPU
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace delphi2csharp
{
public enum TStringListType
{
sltStringsOnly, //Только строки -- сортировка по строкам включена, имеющиеся объекты удалит
sltObjectsOnly, //Только объекты -- сортировка по объектам включена
sltBoth //И строки, и объекты -- сортировка отключена
}
}

View File

@ -1,29 +0,0 @@
using System;
namespace delphi2csharp
{
static public class delphi
{
public static string IncludeTrailingBackslash(string Path)
{
string result = Path;
int Index = Path.Length - 1;
if (Path[Index] != '\\')
{
result = $"{Path}\\";
}
return result;
}
public static string IntToStr(int AInt) => AInt.ToString();
public static string IntToStr(long AInt) => AInt.ToString();
public static long StrToInt(string AStr)
{
long result;
if (!long.TryParse(AStr, out result))
{
result = 0;
}
return result;
}
}
}