-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
DesignMessages.cs
58 lines (50 loc) · 1.53 KB
/
DesignMessages.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Reflection;
using System.Runtime.ExceptionServices;
using System.Xml;
namespace Avalonia.Remote.Protocol.Designer
{
[AvaloniaRemoteMessageGuid("9AEC9A2E-6315-4066-B4BA-E9A9EFD0F8CC")]
public class UpdateXamlMessage
{
public string Xaml { get; set; }
public string AssemblyPath { get; set; }
public string XamlFileProjectPath { get; set; }
}
[AvaloniaRemoteMessageGuid("B7A70093-0C5D-47FD-9261-22086D43A2E2")]
public class UpdateXamlResultMessage
{
public string Error { get; set; }
public string Handle { get; set; }
public ExceptionDetails Exception { get; set; }
}
[AvaloniaRemoteMessageGuid("854887CF-2694-4EB6-B499-7461B6FB96C7")]
public class StartDesignerSessionMessage
{
public string SessionId { get; set; }
}
public class ExceptionDetails
{
public ExceptionDetails()
{
}
public ExceptionDetails(Exception e)
{
if (e is TargetInvocationException)
{
e = e.InnerException;
}
ExceptionType = e.GetType().Name;
Message = e.Message;
if (e is XmlException xml)
{
LineNumber = xml.LineNumber;
LinePosition = xml.LinePosition;
}
}
public string ExceptionType { get; set; }
public string Message { get; set; }
public int? LineNumber { get; set; }
public int? LinePosition { get; set; }
}
}