svg-layout-designer-react/csharp/SVGLDLibs/SVGLDLibs/Models/ContainerProperties.cs
2022-11-09 16:00:24 +01:00

137 lines
No EOL
4.1 KiB
C#

using System.Runtime.Serialization;
using System.Collections.Generic;
namespace SVGLDLibs.Models
{
[DataContract]
public class ContainerProperties
{
/** id of the container */
[DataMember(EmitDefaultValue = false)]
public string id;
/** type matching the configuration on construction */
[DataMember(EmitDefaultValue = false)]
public string type;
/** id of the parent container (null when there is no parent) */
[DataMember(EmitDefaultValue = false)]
public string parentId;
/** id of the linked symbol ('' when there is no parent) */
[DataMember(EmitDefaultValue = false)]
public string linkedSymbolId;
/** Text displayed in the container */
[DataMember(EmitDefaultValue = false)]
public string displayedText;
/** orientation */
[DataMember(EmitDefaultValue =false)]
public Orientation orientation;
/** horizontal offset */
[DataMember(EmitDefaultValue = false)]
public double x;
/** vertical offset */
[DataMember(EmitDefaultValue = false)]
public double y;
/** margin */
[DataMember(EmitDefaultValue = false)]
public Margin margin;
/** width */
[DataMember(EmitDefaultValue = false)]
public double width;
/** height */
[DataMember(EmitDefaultValue = false)]
public double height;
/**
* Minimum width (min=1)
*/
[DataMember(EmitDefaultValue = false)]
public double minWidth;
/**
* Maximum width
*/
[DataMember(EmitDefaultValue = false)]
public double maxWidth;
/**
* Minimum height (min=1)
* Allows the container to set isRigidBody to false when it gets squeezed
* by an anchor
*/
[DataMember(EmitDefaultValue = false)]
public double minHeight;
/**
* Maximum height
*/
[DataMember(EmitDefaultValue = false)]
public double maxHeight;
/** true if anchor, false otherwise */
[DataMember(EmitDefaultValue = false)]
public bool isAnchor;
/** true if flex, false otherwise */
[DataMember(EmitDefaultValue = false)]
public bool isFlex;
/** Horizontal alignment, also determines the visual location of x {Left = 0, Center, Right } */
[DataMember(EmitDefaultValue = false)]
public PositionReferenceEnumModel positionReference;
/** Hide the children in the treeview */
[DataMember(EmitDefaultValue = false)]
public bool hideChildrenInTreeview;
/** Dimension options */
[DataMember(EmitDefaultValue = false)]
public Dimensions dimensionOptions;
/**
* Warnings of a container
*/
[DataMember(EmitDefaultValue = false)]
public string warning;
/**
* (optional)
* Replace a <rect> by a customized "SVG". It is not really an svg but it at least allows
* to draw some patterns that can be bind to the properties of the container
* Use {prop} to bind a property. Use {{ styleProp }} to use an object.
* Example :
* ```
* `<rect width="{width}" height="{height}" style="{style}"></rect>
* <rect width="{width}" height="{height}" stroke="black" fill-opacity="0"></rect>
* <line x1="0" y1="0" x2="{width}" y2="{height}" stroke="black" style='{{ "transform":"scaleY(0.5)"}}'></line>
* <line x1="{width}" y1="0" x2="0" y2="{height}" stroke="black" style='{userData.styleLine}'></line>
* `
* ```
*/
[DataMember(EmitDefaultValue = false)]
public string customSVG;
/**
* (optional)
* Style of the <rect>
*/
[DataMember(EmitDefaultValue = false)]
public CSSStyle style;
/**
* (optional)
* User data that can be used for data storage or custom SVG
*/
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> userData;
}
}