ASP.Net , Newtonsoft.Json. , WinForms, , , ... - !
:
public partial class FlashNotify : Form
{
public string Json { get; set; }
}
:
private void FlashNotify_Load(object sender, EventArgs e)
{
CommUserGroupMessage msg = new CommUserGroupMessage();
msg = Newtonsoft.Json.JsonConvert.DeserializeObject<CommUserGroupMessage>(Json);
}
, :
string json = Newtonsoft.Json.JsonConvert.SerializeObject(msg);
FlashNotify fn = new FlashNotify();
fn.Json = json;
fn.Show();
, , , as this eliminates the need to duplicate a class in your form, which I think makes it easier to maintain( Bugfix: Miss read the static class correctly in the example, I thought at first that it was reproduced inside the form).
source
share