-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathModularityException.Desktop.cs
More file actions
37 lines (33 loc) · 1.65 KB
/
Copy pathModularityException.Desktop.cs
File metadata and controls
37 lines (33 loc) · 1.65 KB
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
#if NETFRAMEWORK
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace Prism.Modularity
{
[Serializable]
public partial class ModularityException
{
/// <summary>
/// Initializes a new instance with serialized data.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected ModularityException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
this.ModuleName = info.GetValue("ModuleName", typeof(string)) as string;
}
/// <summary>
/// Sets the <see cref="System.Runtime.Serialization.SerializationInfo"/> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("ModuleName", this.ModuleName);
}
}
}
#endif