added tools file to contain global useful functions
This commit is contained in:
parent
4c7a7373b4
commit
637baf6e64
2 changed files with 23 additions and 0 deletions
|
@ -39,6 +39,7 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevComponents.DotNetBar2, Version=10.0.0.3, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevComponents.Instrumentation, Version=10.0.0.3, Culture=neutral, PublicKeyToken=bc4a9d761ea44ef0, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
|
@ -64,6 +65,7 @@
|
|||
<Compile Include="splashScreen.Designer.cs">
|
||||
<DependentUpon>splashScreen.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="tools.cs" />
|
||||
<Compile Include="USBTools.cs" />
|
||||
<Compile Include="mainWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
|
21
Saviour Backup System/tools.cs
Normal file
21
Saviour Backup System/tools.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saviour_Backup_System
|
||||
{
|
||||
class tools
|
||||
{
|
||||
public static string Trim(this string value, int maxLength)
|
||||
{
|
||||
if (value.Length > maxLength)
|
||||
{
|
||||
return "..." + value.Substring(value.Length - (maxLength - 3));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue