Files
PepApi.Core/PepLib.Core/Utilities/Util.cs
AJ Isaacs 9088af52de refactor(PepLib.Core): reorganize files into logical folder structure
Move 38 files from root directory into organized subfolders:
- Enums/ (7 files): StatusType, ApplicationType, DrawingType, etc.
- Geometry/ (5 files): Vector, Box, Size, Spacing, Node
- Models/ (15 files): Nest, Plate, Part, Program, Report, etc.
- Utilities/ (7 files): MathHelper, Tolerance, ZipHelper, etc.
- Extensions/ (2 files): PartListExtensions, PlateListExtensions
- Interfaces/ (1 file): IMovable

Update namespaces to follow folder hierarchy (e.g., PepLib.Models).
Add GlobalUsings.cs for internal backward compatibility.
Update Codes/ and IO/ files with new using statements.
Update PepApi.Core consumers to reference new namespaces.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 09:29:13 -05:00

31 lines
795 B
C#

using System.Diagnostics;
namespace PepLib.Utilities
{
public static class Util
{
public static string GetNestFileFormat(string filename)
{
try
{
var name = Path.GetFileName(filename);
var ext = Path.GetExtension(name);
if (name.LastIndexOf(ext) > 5 && !name.Contains("-"))
name = name.Insert(5, "-");
if (name.LastIndexOf(ext) > 8 && char.IsLetter(name[8]))
name = name.Remove(8, 1);
return Path.Combine(Path.GetDirectoryName(filename), name);
}
catch (SystemException ex)
{
Debug.WriteLine(ex.Message);
}
return string.Empty;
}
}
}