Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# .net set exception data

[Serializable]
public class PacketParseException : Exception
{
    public byte[] ByteData
    {
        get
        {
            return (byte[])this.Data["ByteData"];
        }
    }

    public PacketParseException(string message, byte[] data, Exception inner) : base(message, inner)
    {
        this.Data.Add("ByteData", data);
    }
}
Comment

c# .net set exception data

public class BetterException : Exception
{
    protected T GetValue<T>([CallerMemberNameAttribute] string propertyName = "")
    {
        return (T)Data[propertyName];
    }

    protected void SetValue<T>(T value, [CallerMemberNameAttribute] string propertyName = "")
    {
        Data[propertyName] = value;
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: create expression func c# for use in where clause 
Csharp :: how can find github issue closed date 
Csharp :: retrive the last record dynamics 365 by c# 
Csharp :: player not following slide object unity 2d 
Csharp :: use Multiple forms in one Csharp panel in one Windows Form panel 
Csharp :: initialize c# array property of class object site:stackoverflow.com 
Csharp :: c# treeview keep selected node highlight 
Csharp :: beard styles without mustache Intitle:work with me 
Csharp :: kentico 13 api save attachment 
Csharp :: if statement to check if a time is between two times c# 
Csharp :: download and run exe c# 1 button 
Csharp :: c# servercertificatevalidationcallback 
Csharp :: ismirrored c# 
Csharp :: Wait some seconds without blocking UI execution 
Csharp :: como ordenar dados na gridview c# 
Csharp :: Library dll unless netloaded by AutoCAD 
Csharp :: c# instantiation 
Csharp :: c# odd or even 
Csharp :: asp.net razor get list without refresh 
Csharp :: c# linq foreach example 
Csharp :: If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. 
Csharp :: C# predict rotation by an angular velocity 
Csharp :: save a string as file to drive appscript 
Csharp :: c# changimg to one decimal place 
Csharp :: scale curve revit api 
Csharp :: identity-1.us-south.iam.test.cloud.ibm.com:443 
Csharp :: Unity Scale per code ändern 
Csharp :: c# validate username and password 
Csharp :: Nested objects with linq expression 
Csharp :: c# null coalescing operator 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =