Exemple #1
0
        public void notify(Packet packet)
        {
            try {
                if (packet.Type.Equals("result"))
                {
                    voidDel vd = new voidDel(jaberModel.gui.Registered);
                    jaberModel.gui.Invoke(vd);
                }
                else
                {
                    String message = null;
                    if (packet.Type.Equals("error"))
                    {
                        Packet err = packet.getFirstChild("error");
                        message = err["code"] + " : " + err.getValue();

                        RegisterFailedDelegate rfd = new RegisterFailedDelegate(jaberModel.gui.RegistrationFailed);
                        jaberModel.gui.Invoke(rfd, new Object[] { message });
                    }
                    Console.WriteLine(message);
                }
            } catch (Exception ex) {
                Console.WriteLine(ex.ToString());
            }
        }
		public void notify(Packet packet) {
			try {
				if(packet.Type.Equals("result")) {
					voidDel vd = new voidDel(jaberModel.gui.Registered);
					jaberModel.gui.Invoke(vd);
				} else {
					String message = null;
					if(packet.Type.Equals("error")) {
						Packet err = packet.getFirstChild("error");
						message = err["code"] + " : " + err.getValue();

						RegisterFailedDelegate rfd = new RegisterFailedDelegate(jaberModel.gui.RegistrationFailed);
						jaberModel.gui.Invoke(rfd, new Object[] {message});
					}
					Console.WriteLine(message);
				}
			} catch(Exception ex) {
				Console.WriteLine(ex.ToString());
			}
		}