Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/X12.NET.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions X12.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X12.X12Parser", "src\X12.X12Parser\X12.X12Parser.csproj", "{19307F16-3D8C-4E4D-8903-8BAD12EDAE78}"
EndProject
Expand Down Expand Up @@ -50,6 +50,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X12.Specifications", "src\X
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X12.Transformations", "src\X12.Transformations\X12.Transformations.csproj", "{C080E31B-1F81-4F6E-B634-90D834B1811D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X12UtilsFRM", "X12UtilsFRM\X12UtilsFRM.csproj", "{08B4E0A3-3C17-40F5-B986-562232797C60}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -244,6 +246,18 @@ Global
{C080E31B-1F81-4F6E-B634-90D834B1811D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C080E31B-1F81-4F6E-B634-90D834B1811D}.Release|x86.ActiveCfg = Release|Any CPU
{C080E31B-1F81-4F6E-B634-90D834B1811D}.Release|x86.Build.0 = Release|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Debug|x86.ActiveCfg = Debug|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Debug|x86.Build.0 = Debug|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Release|Any CPU.Build.0 = Release|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Release|x86.ActiveCfg = Release|Any CPU
{08B4E0A3-3C17-40F5-B986-562232797C60}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -266,6 +280,7 @@ Global
{29EEAA38-BFB2-4732-A286-EB91355F9BCD} = {FC1769FD-76F2-40B7-9FA3-AC3E2F24D8B2}
{26E9A9D5-D0B4-4B86-83D7-A0A3370A57EA} = {FC1769FD-76F2-40B7-9FA3-AC3E2F24D8B2}
{C080E31B-1F81-4F6E-B634-90D834B1811D} = {FC1769FD-76F2-40B7-9FA3-AC3E2F24D8B2}
{08B4E0A3-3C17-40F5-B986-562232797C60} = {57B7B5ED-5C3D-464D-B67C-7623BBBA8AC0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {82406A0F-880D-4913-8252-9A64EC0C4A3B}
Expand Down
70 changes: 70 additions & 0 deletions X12UtilsFRM/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="X12UtilsFRM.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<X12UtilsFRM.Properties.Settings>
<setting name="SurppressParsingComments" serializeAs="String">
<value>False</value>
</setting>
<setting name="PartnerId" serializeAs="String">
<value>GeorgiaPacific</value>
</setting>
<setting name="PartnerX12VersionId" serializeAs="String">
<value>4010</value>
</setting>
<setting name="TransformFormat" serializeAs="String">
<value>HTML</value>
</setting>
<setting name="X12Folder" serializeAs="String">
<value>C:\EDI\TestCases</value>
</setting>
<setting name="fileList" serializeAs="String">
<value />
</setting>
<setting name="throwExceptions" serializeAs="String">
<value>False</value>
</setting>
<setting name="ParseToXML" serializeAs="String">
<value>False</value>
</setting>
<setting name="ParseToHTML" serializeAs="String">
<value>True</value>
</setting>
<setting name="chkBrowseCheked" serializeAs="String">
<value>False</value>
</setting>
<setting name="chkTargetSchemaChecked" serializeAs="String">
<value>False</value>
</setting>
<setting name="SelectedInfile" serializeAs="String">
<value>5</value>
</setting>
<setting name="SelectedTargetSchema" serializeAs="String">
<value>5</value>
</setting>
</X12UtilsFRM.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
146 changes: 146 additions & 0 deletions X12UtilsFRM/BiztalkFunctoidNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
using System;
using System.Drawing;
using System.Windows.Forms;

namespace X12UtilsFRM
{
public class BizTalkFunctoidNode : Panel
{
public string CustomScript { get; set; }
public string FunctoidName { get; private set; }
public string FunctoidCategory { get; private set; }

public Label LblIcon { get; private set; }
public Label LblText { get; private set; }

// Core tracking variables for drawing cascading links between functoids
private Point mouseStartLoc = Point.Empty;
private bool trackingForLineConnection = false;

public BizTalkFunctoidNode(string text, Point location)
{
this.FunctoidName = text;
this.FunctoidCategory = DetermineCategory(text);

// Configure the outer BizTalk block capsule size
this.Size = new Size(130, 36);
this.Location = location;
this.BorderStyle = BorderStyle.FixedSingle;
this.Cursor = Cursors.SizeAll;

// Determine specific color schemes and symbols based on BizTalk categories
Color headerColor;
Color bodyColor;
string iconSymbol;

switch (this.FunctoidCategory)
{
case "String":
headerColor = Color.FromArgb(0, 122, 204); // BizTalk Blue
bodyColor = Color.FromArgb(235, 245, 255);
iconSymbol = "ℱ"; // Math function script symbol
break;
case "Math":
headerColor = Color.FromArgb(220, 100, 0); // BizTalk Orange/Amber
bodyColor = Color.FromArgb(255, 242, 230);
iconSymbol = "∑"; // Sigma summation symbol
break;
case "Date":
headerColor = Color.FromArgb(16, 124, 65); // BizTalk Green
bodyColor = Color.FromArgb(230, 247, 236);
iconSymbol = "📅"; // Calendar block emoji/glyph
break;
default:
headerColor = Color.FromArgb(100, 100, 100); // Standard Gray
bodyColor = Color.FromArgb(240, 240, 240);
iconSymbol = "⚙";
break;
}

this.BackColor = bodyColor;

// 1. Left Icon Anchor Bar Block
LblIcon = new Label
{
Text = iconSymbol,
Font = new Font("Segoe UI", 11f, FontStyle.Bold),
BackColor = headerColor,
ForeColor = Color.White,
Size = new Size(30, this.Height - 2),
Location = new Point(0, 0),
TextAlign = ContentAlignment.MiddleCenter,
Cursor = Cursors.SizeAll
};
this.Controls.Add(LblIcon);

// 2. Right Text Label Description Strip
LblText = new Label
{
Text = text,
Font = new Font("Segoe UI", 8.25f, FontStyle.Regular),
ForeColor = Color.FromArgb(30, 30, 30),
Size = new Size(95, this.Height - 2),
Location = new Point(32, 0),
TextAlign = ContentAlignment.MiddleLeft,
Cursor = Cursors.SizeAll
};
this.Controls.Add(LblText);

// Seed initial execution script snippet properties
this.CustomScript = FunctoidXsltCompiler.GetXsltSnippet(text, "SOURCE_XPATH_PLACEHOLDER", text.Replace(" ", "_"));

// 3. Register Drag Line Intercept Listeners contextually across all component layout areas
AttachLineDragHooks(this);
AttachLineDragHooks(LblIcon);
AttachLineDragHooks(LblText);
}

private string DetermineCategory(string functoidName)
{
string name = functoidName.ToLower();
if (name.Contains("string") || name.Contains("concat") || name.Contains("trim") || name.Contains("case"))
return "String";
if (name.Contains("add") || name.Contains("sub") || name.Contains("multiply") || name.Contains("divide") || name.Contains("mod") || name.Contains("abs"))
return "Math";
if (name.Contains("date") || name.Contains("time") || name.Contains("diff"))
return "Date";

return "Custom";
}

/// <summary>
/// Binds connection dragging hooks recursively so users can Shift+Drag from anywhere on the control.
/// </summary>
private void AttachLineDragHooks(Control control)
{
control.MouseDown += (s, e) =>
{
if (e.Button == MouseButtons.Left && Control.ModifierKeys == Keys.Shift)
{
trackingForLineConnection = true;
mouseStartLoc = e.Location;
}
};

control.MouseMove += (s, e) =>
{
if (trackingForLineConnection)
{
int dx = Math.Abs(e.X - mouseStartLoc.X);
int dy = Math.Abs(e.Y - mouseStartLoc.Y);

// Once the mouse slips past system drag sensitivity variables, trip the mapper drop engine
if (dx >= SystemInformation.DragSize.Width || dy >= SystemInformation.DragSize.Height)
{
trackingForLineConnection = false;

// Pass THIS entire instance as the underlying link source node reference payload
this.DoDragDrop(this, DragDropEffects.Link);
}
}
};

control.MouseUp += (s, e) => { trackingForLineConnection = false; };
}
}
}
28 changes: 28 additions & 0 deletions X12UtilsFRM/ControlExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

public static class ControlExtensions
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);

private const int WM_SETREDRAW = 0x000B;

public static void BeginUpdate(this Control control)
{
if (control != null && !control.IsDisposed && control.IsHandleCreated)
{
SendMessage(control.Handle, WM_SETREDRAW, 0, IntPtr.Zero);
}
}

public static void EndUpdate(this Control control)
{
if (control != null && !control.IsDisposed && control.IsHandleCreated)
{
SendMessage(control.Handle, WM_SETREDRAW, 1, IntPtr.Zero);
control.Invalidate(true); // Forces a full redraw of the control and its children
}
}
}
Loading