Inheritance: IAnhServiceCallback
Example #1
0
        public Form1()
        {
            ServerCallback = new AnhCallback();
            InitializeComponent();
            ServerCallback.MessageReceived             += new EventHandler <MessageEventArgs>(ServerCallback_MessageReceived);
            ServerCallback.AvailableServerListReceived += new EventHandler <AvailableServerEventArgs>(ServerCallback_AvailableServerListReceived);
            ServerCallback.StatusReceived += new EventHandler <ServerStatusEventArgs>(ServerCallback_StatusReceived);

            ic          = new InstanceContext(ServerCallback);
            client      = new AnhServiceClient(ic);
            ic.Faulted += new EventHandler(ic_Faulted);
            ic.Open();

            Servers s = new Servers(ServerType.ConnectionServer, "");

            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ChatServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.LoginServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.PingServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ZoneServer, "tutorial");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ZoneServer, "tatooine");
            comboBox1.Items.Add(s);
            comboBox1.SelectedIndex = 0;
        }
Example #2
0
        public Form1()
        {
            ServerCallback = new AnhCallback();
            InitializeComponent();
            ServerCallback.MessageReceived += new EventHandler<MessageEventArgs>(ServerCallback_MessageReceived);
            ServerCallback.AvailableServerListReceived += new EventHandler<AvailableServerEventArgs>(ServerCallback_AvailableServerListReceived);
            ServerCallback.StatusReceived += new EventHandler<ServerStatusEventArgs>(ServerCallback_StatusReceived);

            ic = new InstanceContext(ServerCallback);
            client = new AnhServiceClient(ic);
            ic.Faulted += new EventHandler(ic_Faulted);
            ic.Open();

            Servers s = new Servers(ServerType.ConnectionServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ChatServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.LoginServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.PingServer, "");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ZoneServer, "tutorial");
            comboBox1.Items.Add(s);
            s = new Servers(ServerType.ZoneServer, "tatooine");
            comboBox1.Items.Add(s);
            comboBox1.SelectedIndex = 0;
        }