Skip to content

Instantly share code, notes, and snippets.

@netpyoung
Last active November 15, 2016 05:15
Show Gist options
  • Select an option

  • Save netpyoung/1137ffddc555bb512be1df628a8c2160 to your computer and use it in GitHub Desktop.

Select an option

Save netpyoung/1137ffddc555bb512be1df628a8c2160 to your computer and use it in GitHub Desktop.
#region AutoGenerated
public class DataQHello
{
public int A { get; set; }
}
public class DataRHello
{
public int A { get; set; }
}
public abstract class BaseResponseHello
{
public abstract void RHello(int a);
public void RHello(DataRHello data)
{
RHello(data.A);
}
}
public static void QHello(int A, BaseResponseHello callback)
{
QHello(new DataQHello { A = A }, callback);
}
#endregion AutoGenerated
#region HandleLibrary
private static void QHello(DataQHello hello, BaseResponseHello callback)
{
// TODO request handler
callback.RHello(new DataRHello { A = 20 });
}
#endregion HandleLibrary
public class Example : BaseResponseHello
{
public void Start()
{
Program.QHello(A: 10, callback: this);
}
public override void RHello(int a)
{
Console.WriteLine(a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment