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>
46 lines
950 B
C#
46 lines
950 B
C#
namespace PepLib.Geometry
|
|
{
|
|
public class Size
|
|
{
|
|
public Size(double height, double width)
|
|
{
|
|
Height = height;
|
|
Width = width;
|
|
}
|
|
|
|
public double Height { get; set; }
|
|
|
|
public double Width { get; set; }
|
|
|
|
public static Size Parse(string size)
|
|
{
|
|
var a = size.ToUpper().Split('X');
|
|
|
|
var height = double.Parse(a[0]);
|
|
var width = double.Parse(a[1]);
|
|
|
|
return new Size(height, width);
|
|
}
|
|
|
|
public static bool TryParse(string s, out Size size)
|
|
{
|
|
try
|
|
{
|
|
size = Parse(s);
|
|
}
|
|
catch
|
|
{
|
|
size = new Size(0, 0);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format("{0} x {1}", Height, Width);
|
|
}
|
|
}
|
|
}
|