Squashed 'NHotkey/' content from commit e16cceb
git-subtree-dir: NHotkey git-subtree-split: e16cceb7b3e108413d409dbf355a67835822a5e7
This commit is contained in:
36
NHotkey/HotkeyAlreadyRegisteredException.cs
Normal file
36
NHotkey/HotkeyAlreadyRegisteredException.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace NHotkey
|
||||
{
|
||||
[Serializable]
|
||||
public class HotkeyAlreadyRegisteredException : Exception
|
||||
{
|
||||
private readonly string _name;
|
||||
|
||||
public HotkeyAlreadyRegisteredException(string name, Exception inner) : base(inner.Message, inner)
|
||||
{
|
||||
_name = name;
|
||||
HResult = Marshal.GetHRForException(inner);
|
||||
}
|
||||
|
||||
protected HotkeyAlreadyRegisteredException(
|
||||
SerializationInfo info,
|
||||
StreamingContext context) : base(info, context)
|
||||
{
|
||||
_name = (string) info.GetValue("_name", typeof (string));
|
||||
}
|
||||
|
||||
public override void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
base.GetObjectData(info, context);
|
||||
info.AddValue("_name", _name);
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user