Guest User

Untitled

a guest
Jan 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.53 KB | None | 0 0
  1. //IN DER GUI WIRD DER BUTTON "ADDE EIN YOOLET" GEDRÜCKT
  2. protected void onNewYooLetChosen(object sender, ItemEventArgs e)
  3. {
  4.             YooLetModel yM = (YooLetModel)MobileClientData.GetInstance().ConvertType(MobileClientData.GetInstance().getAvailableYooLets()[e.Position]);
  5.             ((ApplicationState)Application).CurrentYooView.Add(yM);
  6. }
  7.  
  8. //DIE ADDED-METHODE (WIRD NUR 1-mal REGISTRIERT)
  9. this.CurrentYooView.Added += delegate(object sender, ObservableDictArgs<Guid, IYooLet> args)
  10. {                
  11.                 YooLetModel yM = (YooLetModel)args.ChangedItem.Value;
  12.                 yM.SetAbsId(args.ChangedItem.Key);
  13.                 yM.SetUp();
  14.                 MobileClientData.GetInstance().CurrentYooLetModels.Add(args.ChangedItem.Key, yM);
  15.                 MobileClientData.GetInstance().activeYooLets.Add(MobileClientData.GetInstance().activeYooLets.Count, args.ChangedItem.Key);
  16.                 if (MobileClientData.GetInstance().CurrentYooLetActivity.Value.GetType() == typeof(RemoteScreen))
  17.                     MobileClientData.GetInstance().CurrentYooLetActivity.Value.UpdateGui();
  18.                 else
  19.                 {
  20.                     //Create Activity
  21.                     Intent i = new Intent();
  22.                     i.SetClass(this, MobileClientData.GetInstance().ConvertType(yM).GetType());
  23.                     i.SetFlags(ActivityFlags.NewTask);
  24.                     i.PutExtra("absId", args.ChangedItem.Key.ToString());
  25.                     StartActivity(i);
  26.                 }                
  27.             };
  28. }
Add Comment
Please, Sign In to add comment