Class Message
An element that stores warning messages.
Implements
Inherited Members
Namespace: Elements.Annotations
Assembly: Hypar.Elements.dll
Syntax
[JsonConverter(typeof(JsonInheritanceConverter), new object[]{"discriminator"})]
public class Message : GeometricElement, INotifyPropertyChanged
Constructors
Message()
Empty constructor.
Declaration
public Message()
Message(String, String, String, MessageSeverity, Transform, Material, Representation, Boolean, Guid, String)
Default json constructor for a message that may have geometry.
Declaration
[JsonConstructor]
public Message(string message, string shortMessage, string stackTrace, MessageSeverity severity, Transform transform = null, Material material = null, Representation representation = null, bool isElementDefinition = false, Guid id = default(Guid), string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | |
| System.String | shortMessage | |
| System.String | stackTrace | |
| MessageSeverity | severity | |
| Transform | transform | |
| Material | material | |
| Representation | representation | |
| System.Boolean | isElementDefinition | |
| System.Guid | id | |
| System.String | name |
Properties
ErrorMaterial
The material used for messages with "Error" severity.
Declaration
public static Material ErrorMaterial { get; set; }
Property Value
| Type | Description |
|---|---|
| Material |
InfoMaterial
The material used for messages with "Info" severity.
Declaration
public static Material InfoMaterial { get; set; }
Property Value
| Type | Description |
|---|---|
| Material |
MessageText
A warning message for the user.
Declaration
[JsonProperty("Message", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string MessageText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Severity
Developer specific message about the failure in the code.
Declaration
[JsonProperty("Severity", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public MessageSeverity Severity { get; set; }
Property Value
| Type | Description |
|---|---|
| MessageSeverity |
ShortMessage
A short message for the user. For a more detailed message, use MessageText.
Declaration
[JsonProperty("ShortMessage", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string ShortMessage { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
StackTrace
Developer specific message about the failure in the code.
Declaration
[JsonProperty("Stack Trace", Required = Required.DisallowNull, NullValueHandling = NullValueHandling.Ignore)]
public string StackTrace { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
WarningMaterial
The material used for messages with "Warning" severity.
Declaration
public static Material WarningMaterial { get; set; }
Property Value
| Type | Description |
|---|---|
| Material |
Methods
DetailsFromException(Exception)
Extract the string details including any stack trace from the exception.
Declaration
public static string DetailsFromException(Exception e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | e | The Exception. |
Returns
| Type | Description |
|---|---|
| System.String |
Error(Nullable<Vector3>, String)
Create an error message.
Declaration
public static Message Error(Vector3? point, string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<Vector3> | point | |
| System.String | message |
Returns
| Type | Description |
|---|---|
| Message |
FromCurve(String, BoundedCurve, MessageSeverity, Double, String, String, String)
Create a simple message along a curve.
Declaration
public static Message FromCurve(string messageText, BoundedCurve curve, MessageSeverity severity = MessageSeverity.Warning, double sideLength = 0.3, string name = null, string stackTrace = null, string shortMessage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | messageText | The message to the user. |
| BoundedCurve | curve | |
| MessageSeverity | severity | The severity of the message. |
| System.Double | sideLength | |
| System.String | name | The name given to the message. |
| System.String | stackTrace | Any stack trace associated with the message. |
| System.String | shortMessage | A short message. |
Returns
| Type | Description |
|---|---|
| Message |
FromPoint(String, Nullable<Vector3>, MessageSeverity, Double, String, String, String)
Create a simple message at a point.
Declaration
public static Message FromPoint(string messageText, Vector3? point, MessageSeverity severity = MessageSeverity.Warning, double sideLength = 0.3, string name = null, string stackTrace = null, string shortMessage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | messageText | The message to the user. |
| System.Nullable<Vector3> | point | |
| MessageSeverity | severity | The severity of the message. |
| System.Double | sideLength | |
| System.String | name | The name given to the message. |
| System.String | stackTrace | Any stack trace associated with the message. |
| System.String | shortMessage | A short message. |
Returns
| Type | Description |
|---|---|
| Message |
FromPolygon(String, Polygon, MessageSeverity, Double, String, String, String)
Create a simple message from a polygon.
Declaration
public static Message FromPolygon(string messageText, Polygon polygon, MessageSeverity severity = MessageSeverity.Warning, double height = 0, string name = null, string stackTrace = null, string shortMessage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | messageText | The message to the user. |
| Polygon | polygon | |
| MessageSeverity | severity | The severity of the message. |
| System.Double | height | |
| System.String | name | The name given to the message. |
| System.String | stackTrace | Any stack trace associated with the message. |
| System.String | shortMessage | A short message. |
Returns
| Type | Description |
|---|---|
| Message |
FromPolygons(String, IEnumerable<Polygon>, MessageSeverity, Double, String, String, String)
Create a simple message from polygons.
Declaration
public static Message[] FromPolygons(string messageText, IEnumerable<Polygon> polygons, MessageSeverity severity = MessageSeverity.Warning, double height = 0, string name = null, string stackTrace = null, string shortMessage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | messageText | The message to the user. |
| System.Collections.Generic.IEnumerable<Polygon> | polygons | |
| MessageSeverity | severity | The severity of the message. |
| System.Double | height | |
| System.String | name | The name given to the message. |
| System.String | stackTrace | Any stack trace associated with the message. |
| System.String | shortMessage | A short message. |
Returns
| Type | Description |
|---|---|
| Message[] |
FromText(String, String, MessageSeverity, String, String)
Create a simple message from the given text.
Declaration
public static Message FromText(string message, string name = null, MessageSeverity severity = MessageSeverity.Warning, string stackTrace = null, string shortMessage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message to the user. |
| System.String | name | The name given to the message. |
| MessageSeverity | severity | The severity of the message. |
| System.String | stackTrace | Any stack trace associated with the message. |
| System.String | shortMessage | A short message. |
Returns
| Type | Description |
|---|---|
| Message |
Info(Nullable<Vector3>, String)
Create an informational message.
Declaration
public static Message Info(Vector3? point, string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<Vector3> | point | |
| System.String | message |
Returns
| Type | Description |
|---|---|
| Message |
Warning(Nullable<Vector3>, String)
Create a warning message.
Declaration
public static Message Warning(Vector3? point, string message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<Vector3> | point | |
| System.String | message |
Returns
| Type | Description |
|---|---|
| Message |