20210706
This commit is contained in:
parent
d406f18d9c
commit
4ce2f8f672
23
anbs_cp/LikeDelphi.cs
Normal file
23
anbs_cp/LikeDelphi.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace delphi2csharp
|
namespace anbs_componentspack
|
||||||
{
|
{
|
||||||
|
public enum TStringListType
|
||||||
|
{
|
||||||
|
sltStringsOnly, //Только строки -- сортировка по строкам включена, имеющиеся объекты удалит
|
||||||
|
sltObjectsOnly, //Только объекты -- сортировка по объектам включена
|
||||||
|
sltBoth //И строки, и объекты -- сортировка отключена
|
||||||
|
}
|
||||||
public class TStringList
|
public class TStringList
|
||||||
{
|
{
|
||||||
private List<string> FLines;
|
private List<string> FLines;
|
26
anbs_cp/TypeConverter.cs
Normal file
26
anbs_cp/TypeConverter.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 16
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 16.0.31424.327
|
VisualStudioVersion = 16.0.31424.327
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
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
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -11,10 +11,10 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{D722F27B-693F-471A-8166-8A7912531A4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{D722F27B-693F-471A-8166-8A7912531A4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D722F27B-693F-471A-8166-8A7912531A4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{442A56CC-1061-4EB5-8B67-3E3D997976D7}.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}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace delphi2csharp
|
|
||||||
{
|
|
||||||
public enum TStringListType
|
|
||||||
{
|
|
||||||
sltStringsOnly, //Только строки -- сортировка по строкам включена, имеющиеся объекты удалит
|
|
||||||
sltObjectsOnly, //Только объекты -- сортировка по объектам включена
|
|
||||||
sltBoth //И строки, и объекты -- сортировка отключена
|
|
||||||
}
|
|
||||||
}
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user