NShape.ModelObjects.Electrical
2.5.0.5
dotnet add package NShape.ModelObjects.Electrical --version 2.5.0.5
NuGet\Install-Package NShape.ModelObjects.Electrical -Version 2.5.0.5
<PackageReference Include="NShape.ModelObjects.Electrical" Version="2.5.0.5" />
<PackageVersion Include="NShape.ModelObjects.Electrical" Version="2.5.0.5" />
<PackageReference Include="NShape.ModelObjects.Electrical" />
paket add NShape.ModelObjects.Electrical --version 2.5.0.5
#r "nuget: NShape.ModelObjects.Electrical, 2.5.0.5"
#:package NShape.ModelObjects.Electrical@2.5.0.5
#addin nuget:?package=NShape.ModelObjects.Electrical&version=2.5.0.5
#tool nuget:?package=NShape.ModelObjects.Electrical&version=2.5.0.5
.NET Diagramming Framework for Industrial Applications
NShape is an Open Source diagram designing framework for .NET WinForms. Software developers use NShape to integrate diagramming capabilities into their applications. Using NShape, applications let users view, annotate, modify and create diagrams like flow charts, wiring schemes or project charts.
- NShape is targeted towards large industrial applications, which differentiates it from most other diagramming frameworks.
- NShape offers all the required basic functionality like glue points, aggregation, undo/redo, zooming, layers and grouping.
- NShape is powerful and scalable to work also with large diagrams of many thousand shapes.
- NShape is template based to enable the user to manage large diagram sets. Modification of templated properties are immediately reflected in all shapes instantiated from this template.
- NShape is style-based, so you can change the look of all diagrams in a project consistently with only a few mouse clicks.
- NShape provides a repository interface to integrate it in your applications persistency concept. A SQL Server and an XML implementation are already contained in the package.
- NShape comes with a built-in permission management to control the actions the user may perform.
- NShape's WinForms controls all implement the Controller-Presenter pattern to allow for perfect integration into your application's user interface.
- NShape promotes a model-view architecture to clearly separate the applications model from the presentation functionality provided by NShape.
- NShape allows for binding shape properties to model properties, which updates the user interface immediately when the corresponding model data changes.
NShape was written in pure C#. For maximum backward compatibility, it is based on .NET Framework 4.0 but can also be combined with all newer versions. Please send an e-mail to support@dataweb.de for all questions regarding NShape.
License
NShape is published under a dual license and you can choose which license is best suited for your project.
- The GNU General Public License version 2 (GPLv2) basically allows you to use and modify the framework in any free program, even if it is used in businesses. Please read the exact license terms delivered in License.rtf together with NShape, if you want to choose this license.
- If your program is not free, that means if you do not publish its source code or if others are not allowed to distribute it, you must buy a license from dataweb in order to use NShape for this program. Please turn to sales@dataweb.de for more information on licensing.
Download
As the main target platform is Windows, we recommend to download the setup installer which contains all you need:
- Source Code
- Sample Programs
- Documentation
- Compiled Assemblies (AnyCPU)
Documentation
The documentation is available here. It is also included in the setup installer as *.chm file (compiled HTML).
Credits
NShape was developed by dataweb GmbH and initially realeased in 2011.
=====
Changes in 2.5.0.0 - 2.5.0.5:
New Features:
- Added support for multiple TargetFrameworks from 3.5 to 9.0
Braking Changes:
- Replaced several public or protected fields with properties, e.g. in class ShapeCollection protected fields "boundingRectangleTight" and "boundingRectangleLoose" with protected properties "BoundingRectangleTight" and "BoundingRectangleLoose".
Interface Changes:
- Renamed NShape specific EventArgs and enums from '...Dg' to 'NShape...': class MouseEventArgsDg renamed to NShapeMouseEventArgs class KeyEventArgsDg renamed to NShapeKeyEventArgs enum MouseButtonsDg renamed to NShapeMouseButtons enum KeysDg renamed to NShapeKeys
Bugfixes:
- Copy diagram as PNG image to clipboard always fails
- Shapes disappeared from the diagram when assigned to a new (visible) layer
- Implementation of 'PutEnhMetafileOnClipboard' no longer returns false all the time
- LabelShapes no longer crashes with an 'Out of Memory' excaption if the line to the glue point has line caps and is shorter than the diameter of the line cap.
- Fix Shape.CalculateCells, Shape.HitTest, Shape.IntersectsWith and Shape.ContainsPoint overloads: Now they respect the line style's thickness
- Fix Project.AddLibrary, Project.AddLibraryByName and Project.AddLibraryByFilePath for .NET 5+
Improvements:
- Display will now use dashed lines for drawing the additional grid lines when zoom is >= 200%
- TextMeasurer uses DisplayService.InfpoGraphics if available.
- Improved XML documentation
- Resolved most warnings (issued by VisualStudio 2022)
- Add tags to common NuGet properties
- Added icon to demo programs
- Added unit tests for CalculateCells, HitTest, IntersectsWith and ContainsPoint for all shape base classes
Changed Behavior:
- The range parameter in HitTest and Find-Functions is no longer added to the 'size' the of control points but also to the shape's outline. This improves 'clickability' of lines.
Changes in 2.4.1.4:
New Features:
- Added constants for default colors to the NShape.WinFormsUI.Display component.
- Added additional properties to the NShape.WinFormsUI.Display component that allow adjusting the color of tool previews/hints: class Display: public Color ToolHintOuterColor { get; } (uses the color of SelectionInteriorColor) public Color ToolHintInnerColor { get; } (uses the color of ToolPreviewColor) NShapeDesigner offers 2 color schemes in the option dialog now that use these new properties.
- Added new methods to the NShape.WinFormsUI.IDiagramPresenter interface (and the Display component that allow drawing and filling multi-segment-lines/polygons: interface IDiagramPresenter: void DrawLines(Point[] lineSegments); void FillPolygon(Point[] polygon);
Interface Changes:
Added methods (including default implementations) for rectangle based hit testing, which is required when using large diagrams in conjunction with small zoom factors (of e.g. <5%): class Shape public abstract ControlPointId HitTest(int x, int y, int width, int height, ControlPointCapabilities controlPointCapability, int range); public abstract ControlPointId FindNearestControlPoint(int x, int y, int width, int height, int range, ControlPointCapabilities controlPointCapability); interface IReadonlyShapeCollection Shape FindShape(int x, int y, int width, int height, ControlPointCapabilities controlPointCapabilities, int distance, Shape startShape); IEnumerable<Shape> FindShapes(int x, int y, int width, int height, ControlPointCapabilities controlPointCapabilities, int distance);
Added a property to the protected class Tool.MouseState in order to enable rectangle based hit testing (see above): Tool.MouseState.CursorArea A Rectangle that represents the (zoomed) mouse cursor's position in diagram coordinates. For ZoomLevel >= 100, it is of size 1. Tool.MouseState.Position Tool.MouseState.X Tool.MouseState.Y For ZoomLevel < 100, these properties represent the center of CursorArea.
Made several methods of Tool and SelectionTool protected virtual for better customizability: class SelectionTool: protected virtual TAction ConvertAction<TAction>(Enum action) where TAction: Enum; protected virtual int DetermineCursor(IDiagramPresenter diagramPresenter, MouseState mouseState); protected virtual TAction DetermineMouseMoveAction<TAction>(IDiagramPresenter diagramPresenter, MouseState mouseState, ShapeAtCursorInfo shapeAtCursorInfo) where TAction: Enum; protected virtual TAction DetermineMouseDownAction<TAction>(IDiagramPresenter diagramPresenter, MouseState mouseState) where TAction: Enum; protected virtual bool IsDragActionFeasible(MouseState mouseState, MouseButtonsDg button); protected virtual bool IsEditCaptionFeasible(IDiagramPresenter diagramPresenter, MouseState mouseState, ShapeAtCursorInfo shapeAtCursorInfo) protected virtual bool IsMoveHandleFeasible(IDiagramPresenter diagramPresenter, MouseState mouseState, ShapeAtCursorInfo shapeAtCursorInfo) protected virtual bool IsMoveShapeFeasible(IDiagramPresenter diagramPresenter, MouseState mouseState, ShapeAtCursorInfo shapeAtCursorInfo); protected virtual bool IsRotatatingFeasible(IDiagramPresenter diagramPresenter, MouseState mouseState, ShapeAtCursorInfo shapeAtCursorInfo);
Added 2 static readonly properties and a static method to the Diagram class that help for checking the maximum size of a bitmap image: public static readonly Size MaxBitmapSize; public static readonly long MaxBitmapPixelCount; // @ 32 BpP public static int GetMaxBitmapPixelCount(PixelFormat pixelFormat) These properties reflect the maximum size (in pixels) a .NET Bitmap image can have. Values above will trigger an exception in the Bitmap's constructor.
Improvements:
- Improved line routing in RectangularLine. When connected to a shape, the first vertex determines the direction of the first segment from the intersection angle with the connected shape. The default routing preference (horizontal or vertical) can be customized by overwriting the new property protected virtual VertexBending FirstVertexDefaultBending { get; }
- Enabled inheriting the XML documentation of base class/method/property for all overridden methods and properties.
- Completed XML documentation of several classes und methods
- Added public constants for the default colors of the Display component
- Fixed several NullReferenceExceptions that occured when the Display has no Tool.
- Diagram.CreateImage() checks for the maximum possible size of bitmap files and throws a property exception if exceeded. Before the fix, a meaningless ArgumentException was raised by the constructor of the System.Drawing.Bitmap class.
- Display.Shape_Click event did not raise for the topmost shape but for a random shape at the same position.
- Changing Color properties of the Display component did not recreate all necessary graphical resources
- Minor bugfixes and improvements
Changes in 2.4.1.0:
Improvements:
- Optimized performance of static conversion functions Layer.ConvertToLayerIds and Layer.ConvertToLayerId
Bugfixes:
- ArithmeticOverflow when loading/saving repositories containing a shape with "SupplementalLayer" set to Layer32 (or a combination containing Layer32).
- Shape.FindNearestControlPoint with parameter 'capabilities' set to ControlPointCapability.Connect no longer prefers ControlPointId.Rference over other connection points
- ShapeGroup did not implement loading/saving HomeLayer (available in future versions)
- Loading/saving Int64 fields was not implemented in SQLStore
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net9.0-windows7.0 is compatible. net10.0-windows was computed. |
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
-
.NETFramework 3.5
-
.NETFramework 4.0
-
.NETFramework 4.5
-
.NETFramework 4.6.1
-
.NETFramework 4.7
-
.NETFramework 4.8
-
All Frameworks
- NShape.Core (>= 2.5.0.5)
-
net6.0-windows7.0
- Microsoft.Data.SqlClient (>= 6.1.3)
-
net8.0-windows7.0
- Microsoft.Data.SqlClient (>= 6.1.3)
-
net9.0-windows7.0
- Microsoft.Data.SqlClient (>= 6.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|