Message class
using System;
using System.Diagnostics;
using System.IO;
using System.ServiceModel;
using System.Collections.Generic;
using System.Collections;
using System.Runtime.Serialization;
using System.Text;
namespace Common
{
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(ICallback))]
[DataContract]
public class Message
{
private int m_From;
private int m_To;
private string m_Message;
private DateTime m_Date;
public Message(int f, int t, string s)
{
m_From = f;
m_To = t;
m_Date = DateTime.Now;
m_Message = s;
}
public Message(int f, int t, string s, DateTime date)
{
m_From = f;
m_To = t;
m_Date = date;
m_Message = s;
}
[DataMember]
public int From
{
get
{
return m_From;
}
set { m_From = value; }
}
[DataMember]
public int To
{
get
{
return m_To;
}
set { m_To = value; }
}
[DataMember]
public DateTime Date
{
get
{
return m_Date;
}
set { m_Date = value; }
}
[DataMember]
public string MessageText
{
get
{
return m_Message;
}
set { m_Message = value; }
}
}
}
Related examples in the same category