示例#1
0
 public static void ShowChildModelInNewScreen(this RecursiveFieldView self, JsonSchemaToView viewGenerator, GameObject currentScreen, JObject jObj)
 {
     self.openButton.SetOnClickAction(async delegate {
         var newScreen = await self.NewViewFromSchema(viewGenerator);
         var viewStack = currentScreen.GetViewStack();
         viewStack.ShowView(newScreen, currentScreen);
         var presenter        = new JsonSchemaPresenter(viewGenerator);
         presenter.targetView = newScreen;
         await presenter.LoadModelIntoView(jObj);
     }).LogOnError();
 }
示例#2
0
 /// <summary> Converts the passed model to JSON, lets the user edit it and returned a
 /// parsed back clone with all changes made by the user, so that this new state can be
 /// stored or the changed fields can be calculated via MergeJson.GetDiff() </summary>
 /// <param name="model"> The model that should be shown in the UI (has to fit the loaded view model UI) </param>
 /// <returns> The modified model after the passed userSavedChanges-Task is completed </returns>
 public static async Task <T> LoadViaJsonIntoView <T>(this Presenter <JObject> self, T model, bool autoCheckUiVsLatestModel = true)
 {
     return(await LoadViaJsonIntoView(self, model, JsonSchemaPresenter.ChangesSavedViaConfirmButton(self.targetView), autoCheckUiVsLatestModel));
 }