static void Main(string[] args) { MQHandler <XItem> mq = new MQHandler <XItem>("sycoexample2"); while (true) { var temp = GetRandomItem(); mq.Send(temp); Console.WriteLine("New Item sent: " + temp.Description + ", " + temp.Price + ", " + temp.Amount + ", " + temp.Category); Thread.Sleep(5000); } }
private void WriteToQueue() { MessageBox.Show("Wird abgeschickt!"); handler.Send(new PersonenBeschreibung() { Alter = this.Alter, Name = this.Name, Blutgruppe = this.Blutgruppe, Id = Guid.NewGuid(), isEinLanger = this.isEinLanger, Wohnort = this.Wohnort }); updatePersonen(); }
private void updateById(object param) { PersonenBeschreibung temp = new PersonenBeschreibung(); if (param.GetType() == temp.GetType()) { temp = (PersonenBeschreibung)param; MessageBox.Show("Updating " + temp.Name); //todo: schicke update an message queue handlerUpdate.Send(temp); //Write Update in File clientFileWriter.WriteInFile("Updated " + temp.Id); } }
private void deleteById(object param) { MessageBox.Show("Deleting " + param.ToString()); //Delete directly by calling WCF //client.deleteById(param.ToString()); //Delete with MQ PersonenBeschreibung temp = getPersonById(param.ToString()); handlerDelete.Send(temp); //remove from Observablecollection for WPF removePersonById(param.ToString()); }