/DiagramNet

Diagram.NET is a free open-source diagramming tools written entirely in C#.

Primary LanguageC#Apache License 2.0Apache-2.0

Diagram.NET

Diagram.NET is a free open-source diagramming tools written entirely in C#.

Put Diagram.NET WinForm Control into your form and, like Microsoft Visio®, the user can draw shapes and links. With some code you can control, change, add and delete these elements.

Background

This would appear to have been a reasonably popular diagramming control for WinForms development.

Unfortunately, the company behind this component is now defunct. Technology has moved on and this component is now not compatible with .NET Core. The source code is not available, so there is no way to make this component compatible.

Further, the last available source is v0.4 whereas the last available binary is at v0.5

JetBrains dotPeek is a .NET decompiler and assembly browser. This has allowed us to decompile the component and make it compatible with newer technologies.

Prerequisites

  • .NET Core 6.0
  • Windows

Getting started

$ git clone https://github.com/TrevorDArcyEvans/DiagramNet.git
$ cd DiagramNet
$ dotnet restore
$ dotnet build

# run test app
$ dotnet run --project TestForm/TestForm.csproj

Breaking changes for migration from .NET Framework to .NET Core

Starting in .NET Core 3.1, some Windows Forms controls are no longer available.

Each removed control has a recommended replacement control. Refer to the following table:

Removed control (API) Recommended replacement Associated APIs that are removed
ContextMenu ContextMenuStrip
DataGrid DataGridView DataGridCell, DataGridRow, DataGridTableCollection, DataGridColumnCollection, DataGridTableStyle, DataGridColumnStyle, DataGridLineStyle, DataGridParentRowsLabel, DataGridParentRowsLabelStyle, DataGridBoolColumn, DataGridTextBox, GridColumnStylesCollection, GridTableStylesCollection, HitTestType
MainMenu MenuStrip
Menu ToolStripDropDown, ToolStripDropDownMenu MenuItemCollection
MenuItem ToolStripMenuItem
ToolBar ToolStrip ToolBarAppearance
ToolBarButton ToolStripButton ToolBarButtonClickEventArgs, ToolBarButtonClickEventHandler, ToolBarButtonStyle, ToolBarTextAlign

TODO

  • port to .NET Core 6
  • fix test app
  • test round trip serialisation
  • company+author+copyright credits

Further work

  • finish integration of DocumentBlock