Skip to main content

Posts

Showing posts with the label Observer

Example - Chat Application

1. Create a WCF Service library project Open Visual Studio > File  >  New  >  Project Select  WCF Service Library  template under  Visual C# > WCF  templates Change the name to  ChatServiceLibrary  and click  OK Visual studio will add reference to System.ServiceModel and System.Runtime.Serialization and will add some files with sample code.  Delete IService1.cs and Service1.cs and add a new class called ChatService 1.1 Create the Data Contract  Open ChatService.cs file that you created. Add  using System.ServiceModel; Add  using System.Runtime.Serialization; Add the following code above ChatService class    [DataContract]     public class ChatMsg     {         public ChatMsg() { }         public ChatMsg(string n, string m){ this.User = n; this.Msg = m;}            ...