private void OnDestroy() { SingletonMonoBehaviour <TutorialGuideManager> .instance = null; tutorialDialog = null; req = null; model = null; }
protected override bool Init() { UISortieShipCharacter uIShipCharacter = SortieMapTaskManager.GetUIShipCharacter(); uIShipCharacter.SetShipData(SortieBattleTaskManager.GetMapManager().Deck.GetFlagShip()); TutorialModel tutorial = SortieBattleTaskManager.GetMapManager().UserInfo.Tutorial; if (SortieBattleTaskManager.GetMapManager().UserInfo.StartMapCount >= 5) { SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(tutorial, TutorialGuideManager.TutorialID.BattleShortCutInfo, null, delegate { _disShipMoveObserver = Observable.FromCoroutine((UniRx.IObserver <bool> observer) => ShipMove(observer)).Subscribe(delegate { SortieMapTaskManager.ReqMode(SortieMapTaskManagerMode.Event); }); }); } else { _disShipMoveObserver = Observable.FromCoroutine((UniRx.IObserver <bool> observer) => ShipMove(observer)).Subscribe(delegate { SortieMapTaskManager.ReqMode(SortieMapTaskManagerMode.Event); }); } return(true); }
public ActionResult Edit(TutorialModel turialModel) { var repository = ServiceFactory.GetInstance <ITutorialRepository>(); var tutorial = repository.GetByIDWithTutorialCategory(turialModel.ID); if (ModelState.IsValid) { tutorial.Name = turialModel.Name; tutorial.HtmlContent = turialModel.HtmlContent.ToHtmlEncode(); repository.SaveChanges(); return(RedirectToAction("Category", "Tutorial", new { catType = 1, id = tutorial.TutorialCategory.ID, })); } else { turialModel = new TutorialModel() { ID = tutorial.ID, Name = tutorial.Name, HtmlContent = tutorial.HtmlContent.ToHtmlDecode(), DateCreated = tutorial.DateCreated }; } return(View(turialModel)); }
private IEnumerator LoadTutorial(TutorialModel model, TutorialID ID, Action OnLoaded) { KeyControl key = null; if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : true); key = App.OnlyController; App.OnlyController = new KeyControl(); } req = Resources.LoadAsync("Prefabs/TutorialGuide/TutorialDialog_" + ID.ToString()); yield return(req); tutorialDialog = null; tutorialDialog = Util.Instantiate(req.asset).GetComponent <TutorialDialog>(); tutorialDialog.SetTutorialId(ID); model.SetKeyTutorialFlg((int)ID); tutorialDialog.SetOnLoaded(OnLoaded); req = null; if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : false); App.OnlyController = key; } }
public void Init() { this.TransportKeyController = new KeyControl(0, 0, 0.4f, 0.1f); this.mStrategyMapManager = StrategyTopTaskManager.GetLogicManager(); this.mMinimumSetTankerValue = 0; this.mMaximumSetTankerValue = 30; this.mAlreadySetTankerValue = this.mStrategyMapManager.Area.get_Item(this.top.areaID).GetTankerCount().GetCount(); this.mOwnUsableTankerValue = this.mStrategyMapManager.GetNonDeploymentTankerCount().GetCountNoMove(); if (this.mOwnUsableTankerValue + this.mAlreadySetTankerValue < 30) { this.mMaximumSetTankerValue = this.mOwnUsableTankerValue + this.mAlreadySetTankerValue; } this.needTankerNum.textInt = this.mStrategyMapManager.Area.get_Item(this.top.areaID).GetTankerCount().GetReqCount(); this.mSetTankerValue = this.mAlreadySetTankerValue + (this.top.TankerCount - this.mAlreadySetTankerValue); this.OnUpdatedTankerValue(this.mSetTankerValue); base.get_gameObject().SafeGetTweenAlpha(0f, 1f, 0.3f, 0f, UITweener.Method.Linear, UITweener.Style.Once, null, string.Empty); this.top.isChangeMode = false; TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; bool flag = SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(tutorial, TutorialGuideManager.TutorialID.TankerDeploy, null, delegate { this.TransportKeyController.IsRun = true; }); if (flag) { this.TransportKeyController.IsRun = false; } }
private void ChangeStateCommandMenu() { if (mIsEndPhase) { return; } if (StrategyTopTaskManager.GetLogicManager().IsValidDeploy(StrategyTopTaskManager.Instance.TileManager.FocusTile.areaID, top.TankerCount, EscortOrganizeTaskManager.GetEscortManager())) { StrategyTopTaskManager.GetLogicManager().Deploy(top.areaID, top.TankerCount, EscortOrganizeTaskManager.GetEscortManager()); StrategyTopTaskManager.CreateLogicManager(); isPlayVoice = false; EscortFlagShipModel = null; top.backToCommandMenu(); mIsEndPhase = true; SoundUtils.PlaySE(SEFIleInfos.CommonEnter1); if (PanelShowCor != null) { StopCoroutine(PanelShowCor); } TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; if (tutorial.GetStep() == 8 && !tutorial.GetStepTutorialFlg(9)) { tutorial.SetStepTutorialFlg(9); CommonPopupDialog.Instance.StartPopup("「はじめての配備!」 達成"); SoundUtils.PlaySE(SEFIleInfos.SE_012); } StrategyTopTaskManager.Instance.setActiveStrategy(isActive: true); } else { SoundUtils.PlaySE(SEFIleInfos.CommonCancel2); CommonPopupDialog.Instance.StartPopup("変更がありません", 0, CommonPopupDialogMessage.PlayType.Long); } }
public void ResetBtnEL(GameObject obj) { if (!string.IsNullOrEmpty(this.changeState)) { return; } if (this.isEnd || !this.isControl) { return; } TutorialModel tutorial = OrganizeTaskManager.logicManager.UserInfo.Tutorial; if (SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID != 1 && SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckFirstTutorial(tutorial, TutorialGuideManager.TutorialID.Bring)) { SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(tutorial, TutorialGuideManager.TutorialID.Bring, null); return; } this.isEnd = true; this.isControl = false; this.detailManager.Close(); SoundUtils.PlaySE(SEFIleInfos.CommonEnter2); this.changeState = "top"; OrganizeTaskManager.Instance.GetLogicManager().UnsetOrganize(OrganizeTaskManager.Instance.GetTopTask().GetDeckID(), TaskOrganizeTop.BannerIndex - 1); OrganizeTaskManager.Instance.GetTopTask().UpdateAllBannerByRemoveShip(false); OrganizeTaskManager.Instance.GetTopTask().UpdateAllSelectBanner(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.setDisable(); OrganizeTaskManager.Instance.GetListTask().UpdateList(); }
private async void MainPage_Loaded(object sender, RoutedEventArgs e) { MainDisplayFrame.Navigate(typeof(DashboardPage)); try { await StoreServices.SetupStoreServices(); LicenseInformation LicenseInformation = CurrentApp.LicenseInformation; StoreServices.CheckFreemiumStatus(); StoreServices.CheckForPremiumStatus(); AdVisibility = StoreServices.RemoveAds || StoreServices.IsPremium ? Visibility.Collapsed : Visibility.Visible; PremiumFeatures = StoreServices.IsPremium; _tutorialModels = ConfigurationServices.GetTutorialLinks(); } catch { //if this fails we want to eat it silently. //we have a backup for tutorials null and //the user doesn't care about telemetry } this.DataContext = this; }
public void Init() { TransportKeyController = new KeyControl(); mStrategyMapManager = StrategyTopTaskManager.GetLogicManager(); mMinimumSetTankerValue = 0; mMaximumSetTankerValue = 30; mAlreadySetTankerValue = mStrategyMapManager.Area[top.areaID].GetTankerCount().GetCount(); mOwnUsableTankerValue = mStrategyMapManager.GetNonDeploymentTankerCount().GetCountNoMove(); if (mOwnUsableTankerValue + mAlreadySetTankerValue < 30) { mMaximumSetTankerValue = mOwnUsableTankerValue + mAlreadySetTankerValue; } needTankerNum.textInt = mStrategyMapManager.Area[top.areaID].GetTankerCount().GetReqCount(); mSetTankerValue = mAlreadySetTankerValue + (top.TankerCount - mAlreadySetTankerValue); OnUpdatedTankerValue(mSetTankerValue); base.gameObject.SafeGetTweenAlpha(0f, 1f, 0.3f, 0f, UITweener.Method.Linear, UITweener.Style.Once, null, string.Empty); top.isChangeMode = false; TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; if (SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(tutorial, TutorialGuideManager.TutorialID.TankerDeploy, null, delegate { TransportKeyController.IsRun = true; })) { TransportKeyController.IsRun = false; } }
public ActionResult View(int cat, int id) { var tutorialRepository = _tutorialRepository; var viewedTutorial = tutorialRepository.GetQuery() .Include("Comments") .Include("TutorialCategory") .First(r => r.ID == id); var model = new TutorialModel() { ID = viewedTutorial.ID, Name = viewedTutorial.Name, HtmlContent = viewedTutorial.HtmlContent.ToHtmlDecode(), DateCreated = viewedTutorial.DateCreated, Category = new CategoryModel() { CategoryId = viewedTutorial.TutorialCategory.ID }, Comments = viewedTutorial.Comments .Where(c => c.IsApproved) .Select(c => new CommentModel() { Id = c.ID, CommentText = c.CommentText, AnonymousName = c.AnonymousName, DateCreated = c.DateCreated, Email = c.Email, Website = c.Website, IsValidWebSite = c.IsValidWebSite.HasValue? c.IsValidWebSite.Value : false }) }; return(View(model)); }
XmlElement GetElement(TutorialModel model) { XmlElement xmlElement = xmlDoc.CreateElement("TutorialModel"); // xmlElement.SetAttribute("title", model.title); // xmlElement.SetAttribute(" FieldInfo[] fields = model.GetType().GetFields(); for (int pos = 0; pos < fields.Length; pos++) { FieldInfo fileInfo = fields[pos]; if (fileInfo.FieldType == typeof(GameObject)) { GameObject go = fileInfo.GetValue(model) as GameObject; if (null != go) { xmlElement.SetAttribute(fileInfo.Name, GetRelativePath(go.transform)); } } else if (fileInfo.FieldType.BaseType != typeof(System.Array)) { xmlElement.SetAttribute(fileInfo.Name, fileInfo.GetValue(model).ToString()); } else { // xmlElement.SetAttribute(fileInfo.Name, fileInfo.GetValue(model).ToString()); System.Array array = fileInfo.GetValue(model) as System.Array; XmlElement child = CreateElementFromArray(fileInfo.GetValue(model) as System.Array, fileInfo.Name); xmlElement.AppendChild(child); } } return(xmlElement); }
public static void Activate() { TutorialModel tutorialModel = new TutorialModel(); ViewModel.ViewModelLocator.TutorialViewModel.Model = tutorialModel; GACore.UI.ViewModel.ViewModelLocator.IPAddressViewModel.IPAddress = IPAddress.Loopback; }
public ActionResult Create(int id) { var model = new TutorialModel(); model.Category.CategoryId = id; return(View(model)); }
public bool CheckFirstTutorial(TutorialModel model, TutorialID ID) { if (!model.GetKeyTutorialFlg((int)ID) && CheckTutorialCondition(ID) && req == null) { return(true); } return(false); }
public async Task <IHttpActionResult> UpdateTutorial([FromBody] TutorialModel model, [FromUri] int tutorialId) { Tutorial tutorial = Mapper.Map <Tutorial>(model); await this._tutorialManager.UpdateTutorial(tutorial, tutorialId, model.CategoryId); return(this.StatusCode(HttpStatusCode.NoContent)); }
public ActionResult LoadFile2(TutorialModel tutorial) { var test = tutorial.Attachment2.InputStream; string result = new StreamReader(test).ReadToEnd(); return(Json(result, JsonRequestBehavior.AllowGet)); }
public bool CheckAndShowFirstTutorial(TutorialModel model, TutorialID ID, Action OnLoaded) { if (!model.GetKeyTutorialFlg((int)ID) && CheckTutorialCondition(ID) && req == null) { StartCoroutine(LoadTutorial(model, ID, OnLoaded)); return(true); } return(false); }
public bool CheckAndShowFirstTutorial(TutorialModel model, TutorialGuideManager.TutorialID ID, Action OnLoaded) { if (!model.GetKeyTutorialFlg((int)ID) && this.CheckTutorialCondition(ID) && this.req == null) { base.StartCoroutine(this.LoadTutorial(model, ID, OnLoaded)); return(true); } return(false); }
public bool FirstInit() { if (!this.IsCreate) { TaskOrganizeTop.KeyController = OrganizeTaskManager.GetKeyControl(); TaskOrganizeTop.KeyController.IsRun = false; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(true); this.logicManager = OrganizeTaskManager.Instance.GetLogicManager(); TaskOrganizeTop.decks = new EscortDeckModel[] { OrganizeTaskManager.Instance.GetLogicManager().MapArea.GetEscortDeck() }; ShipModel[] ships = TaskOrganizeTop.decks[0].GetShips(); TaskOrganizeTop.allShip = this.logicManager.GetShipList(); TaskOrganizeTop.BannerIndex = 1; TaskOrganizeTop.SystemIndex = 0; base.isControl = true; EscortOrganizeTaskManager._clsTop.setControlState(); this._bannerManager = new OrganizeBannerManager[6]; for (int i = 0; i < 6; i++) { Util.FindParentToChild <OrganizeBannerManager>(ref this._bannerManager[i], this._bannerPanel.get_transform(), "ShipSlot" + (i + 1)); this._bannerManager[i].init(i + 1, new Predicate <OrganizeBannerManager>(this.OnCheckDragDropTarget), new Action <OrganizeBannerManager>(this.OnDragDropStart), new Predicate <OrganizeBannerManager>(this.OnDragDropRelease), new Action(this.OnDragDropEnd), false); if (ships.Length > i) { this._bannerManager[i].setBanner(ships[i], true, null, true); } this._bannerManager[i].UpdateBanner(false); } this._bannerManager[0].UpdateBanner(true); this.DelayAction(0.3f, delegate { TaskOrganizeTop.KeyController.IsRun = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(false); }); Transform parent = this._bgPanel.get_transform().FindChild("SideButtons"); Util.FindParentToChild <UIButton>(ref this._allUnsetBtn, parent, "AllUnsetBtn"); Util.FindParentToChild <UIButton>(ref this._tenderBtn, parent, "TenderBtn"); Util.FindParentToChild <UIButton>(ref this._fleetNameBtn, parent, "DeckNameBtn"); base.currentDeck = EscortOrganizeTaskManager.GetEscortManager().EditDeck; base.UpdateSystemButtons(); base.isControl = false; TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; if (!SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(tutorial, TutorialGuideManager.TutorialID.EscortOrganize, null, delegate { this.IsCreate = true; base.isControl = true; })) { base.isControl = true; this.IsCreate = true; } } return(true); }
public new bool FirstInit() { if (!IsCreate) { TaskOrganizeTop.KeyController = OrganizeTaskManager.GetKeyControl(); TaskOrganizeTop.KeyController.IsRun = false; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : true); logicManager = OrganizeTaskManager.Instance.GetLogicManager(); TaskOrganizeTop.decks = new EscortDeckModel[1] { OrganizeTaskManager.Instance.GetLogicManager().MapArea.GetEscortDeck() }; ShipModel[] ships = TaskOrganizeTop.decks[0].GetShips(); TaskOrganizeTop.allShip = logicManager.GetShipList(); TaskOrganizeTop.BannerIndex = 1; TaskOrganizeTop.SystemIndex = 0; base.isControl = true; EscortOrganizeTaskManager._clsTop.setControlState(); _bannerManager = new OrganizeBannerManager[6]; for (int i = 0; i < 6; i++) { Util.FindParentToChild(ref _bannerManager[i], _bannerPanel.transform, "ShipSlot" + (i + 1)); _bannerManager[i].init(i + 1, OnCheckDragDropTarget, OnDragDropStart, OnDragDropRelease, OnDragDropEnd, isInitPos: false); if (ships.Length > i) { _bannerManager[i].setBanner(ships[i], openAnimation: true, null, isShutterHide: true); } _bannerManager[i].UpdateBanner(enabled: false); } _bannerManager[0].UpdateBanner(enabled: true); this.DelayAction(0.3f, delegate { TaskOrganizeTop.KeyController.IsRun = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable: false); }); Transform parent = _bgPanel.transform.FindChild("SideButtons"); Util.FindParentToChild(ref _allUnsetBtn, parent, "AllUnsetBtn"); Util.FindParentToChild(ref _tenderBtn, parent, "TenderBtn"); Util.FindParentToChild(ref _fleetNameBtn, parent, "DeckNameBtn"); base.currentDeck = EscortOrganizeTaskManager.GetEscortManager().EditDeck; UpdateSystemButtons(); base.isControl = false; TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; if (!SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(tutorial, TutorialGuideManager.TutorialID.EscortOrganize, null, delegate { IsCreate = true; base.isControl = true; })) { base.isControl = true; IsCreate = true; } } return(true); }
public async Task <IHttpActionResult> AddTutorial([FromBody] TutorialModel model) { Tutorial tutorial = Mapper.Map <Tutorial>(model); tutorial = await this._tutorialManager.AddTutorial(tutorial, model.CategoryId, HttpContext.Current.Request.UserHostAddress, HttpContext.Current.User.Identity.Name); TutorialModel returnModel = Mapper.Map <TutorialModel>(tutorial); return(this.Ok(returnModel)); }
public async Task <bool> InsertTutorial(TutorialModel tutorialModel) { using (var tutorialsContext = new TutorialsContext()) { tutorialsContext.Add(tutorialModel); await tutorialsContext.SaveChangesAsync(); } return(true); }
public async Task <bool> DeleteTutorial(TutorialModel tutorialModel) { using (var tutorialsContext = new TutorialsContext()) { var tracking = tutorialsContext.Remove(tutorialModel); await tutorialsContext.SaveChangesAsync(); var isDeleted = tracking.State == EntityState.Deleted; return(isDeleted); } }
private IEnumerator ShowTutorial(int enableDeckNum) { bool TutorialFinished2 = false; bool isTutorialShow2 = false; TutorialModel model = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; if (enableDeckNum >= 1) { isTutorialShow2 = SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(model, TutorialGuideManager.TutorialID.Rebellion_EnableIntercept, delegate { SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog().OnClosed = delegate { TutorialFinished2 = true; }; }); } else if (enableDeckNum == 0) { isTutorialShow2 = SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(model, TutorialGuideManager.TutorialID.Rebellion_DisableIntercept, delegate { SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog().OnClosed = delegate { TutorialFinished2 = true; }; }); } if (isTutorialShow2) { while (!TutorialFinished2) { yield return(new WaitForEndOfFrame()); } } isTutorialShow2 = false; TutorialFinished2 = false; if (enableDeckNum >= 2) { isTutorialShow2 = SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(model, TutorialGuideManager.TutorialID.Rebellion_CombinedFleet, delegate { SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog().OnClosed = delegate { TutorialFinished2 = true; }; }); } if (isTutorialShow2) { while (!TutorialFinished2) { yield return(new WaitForEndOfFrame()); } } }
private bool OnStartSortieStage() { mKeyController.IsRun = false; mKeyController.ClearKeyAll(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false; SingletonMonoBehaviour <Live2DModel> .Instance.forceStop(); SingletonMonoBehaviour <FadeCamera> .Instance.isDrawNowLoading = false; SingletonMonoBehaviour <NowLoadingAnimation> .Instance.isNowLoadingAnimation = true; SoundUtils.PlaySE(SEFIleInfos.CommonEnter3); DebugUtils.SLog("OnStartSortieStage1"); mStageConfirm.Hide(); DebugUtils.SLog("OnStartSortieStage2"); DOTween.Sequence().Append(mRouletteSelector.transform.DOLocalMoveY(0f, 0.4f).SetEase(Ease.OutBounce)).Join(mRouletteSelector.transform.DOScale(new Vector3(1.6f, 1.6f, 1f), 0.3f)); ShipUtils.PlayShipVoice(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.GetFlagShip(), App.rand.Next(13, 15)); DebugUtils.SLog("OnStartSortieStage3"); this.DelayAction(0.5f, delegate { DebugUtils.SLog("OnStartSortieStage mStageConfirm.ClickAnimation"); MapModel mMapModel = mStageConfirm.mMapModel; RetentionData.SetData(new Hashtable { { "sortieMapManager", mSortieManager.GoSortie(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.Id, mMapModel.MstId) }, { "rootType", 0 }, { "shipRecoveryType", ShipRecoveryType.None }, { "escape", false } }); UnityEngine.Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject); UnityEngine.Object.Destroy(GameObject.Find("Information Root")); UnityEngine.Object.Destroy(GameObject.Find("OverView")); StartCoroutine(AsyncLoad()); MapTransitionCutManager component = Util.Instantiate(mPrefab_MapTransitionCutManager.gameObject, base.transform.root.Find("Map Root").gameObject).GetComponent <MapTransitionCutManager>(); component.transform.localPosition = mStrategyTopTaskManager.strategyCamera.transform.localPosition + new Vector3(-26.4f, -43f, 496.4f); component.Initialize(mMapModel, mAsyncOperation); TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; SingletonMonoBehaviour <AppInformation> .Instance.NextLoadType = AppInformation.LoadType.Ship; DebugUtils.SLog("OnStartSortieStage mStageConfirm.ClickAnimation END"); }); DebugUtils.SLog("OnStartSortieStage4"); return(false); }
private void SuppressTutorials() { TutorialModel tutorial = StrategyTopTaskManager.GetLogicManager().UserInfo.Tutorial; for (int i = 0; i < 20; i++) { tutorial.SetStepTutorialFlg(i); } for (int j = 0; j < 99; j++) { tutorial.SetKeyTutorialFlg(j); } }
private async void DeleteRow_Swiped(object sender, SwipedEventArgs e) { bool resultado = await DisplayAlert("Eliminar", "¿Seguro que desea eliminar el registro?", "Si", "No"); if (resultado) { var contenedor = ((Frame)sender).GestureRecognizers[0]; TutorialModel tutorialModel = ((TapGestureRecognizer)contenedor).CommandParameter as TutorialModel; Vm.DeleteRowCommand.Execute(tutorialModel); } }
private IEnumerator StepTutorialInstantiateForWaitFirstTutorial(TutorialModel model, Action OnFinish) { SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(model, TutorialGuideManager.TutorialID.PortTopText, null); SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(model, TutorialGuideManager.TutorialID.RepairInfo, delegate { UIRebellionOrgaizeShipBanner component2 = ((Component)SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog().View.FindChild("ShipBanner")).GetComponent <UIRebellionOrgaizeShipBanner>(); ShipModel[] ships2 = SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.GetShips(); int num2 = 1; for (int j = 0; j < ships2.Length; j++) { if ((float)(ships2[j].NowHp / ships2[j].MaxHp) < 0.7f) { num2 = j; break; } } component2.SetShipData(ships2[num2], num2 + 1); }); SingletonMonoBehaviour <TutorialGuideManager> .Instance.CheckAndShowFirstTutorial(model, TutorialGuideManager.TutorialID.SupplyInfo, delegate { UIRebellionOrgaizeShipBanner component = ((Component)SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog().View.FindChild("ShipBanner")).GetComponent <UIRebellionOrgaizeShipBanner>(); ShipModel[] ships = SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.GetShips(); int num = 1; for (int i = 0; i < ships.Length; i++) { if (ships[i].AmmoRate < 50.0 || ships[i].FuelRate < 50.0) { num = i; break; } } component.SetShipData(ships[num], num + 1); }); while (!(SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog() != null)) { yield return(null); } SingletonMonoBehaviour <TutorialGuideManager> .Instance.GetTutorialDialog().OnClosed = delegate { this.StepTutorialInstantiate(model); if (OnFinish != null) { OnFinish(); } }; }
public ActionResult Edit(int id) { var repository = ServiceFactory.GetInstance <ITutorialRepository>(); var tutorial = repository.GetByIDWithTutorialCategory(id); var model = new TutorialModel() { ID = tutorial.ID, Name = tutorial.Name, HtmlContent = tutorial.HtmlContent.ToHtmlDecode(), DateCreated = tutorial.DateCreated }; return(View(model)); }
public async void UpdateRow_Tapped(object sender, EventArgs e) { var contenedor = ((Frame)sender).GestureRecognizers[0]; TutorialModel tutorialModel = ((TapGestureRecognizer)contenedor).CommandParameter as TutorialModel; string Titulo = await DisplayPromptAsync("Titulo", tutorialModel.TutorialTitulo); string Descripcion = await DisplayPromptAsync("Descripción", tutorialModel.TutorialDescripcion); tutorialModel.TutorialTitulo = Titulo; tutorialModel.TutorialDescripcion = Descripcion; Vm.UpdateRowCommand.Execute(tutorialModel); }
XmlElement GetElement(TutorialModel model) { XmlElement xmlElement = xmlDoc.CreateElement ("TutorialModel"); // xmlElement.SetAttribute("title", model.title); // xmlElement.SetAttribute(" FieldInfo[] fields = model.GetType().GetFields(); for( int pos = 0; pos < fields.Length; pos++ ){ FieldInfo fileInfo = fields[pos]; if(fileInfo.FieldType == typeof(GameObject)){ GameObject go = fileInfo.GetValue(model) as GameObject; if( null != go ) xmlElement.SetAttribute(fileInfo.Name, GetRelativePath(go.transform)); } else if(fileInfo.FieldType.BaseType != typeof(System.Array) ) xmlElement.SetAttribute(fileInfo.Name, fileInfo.GetValue(model).ToString()); else{ // xmlElement.SetAttribute(fileInfo.Name, fileInfo.GetValue(model).ToString()); System.Array array = fileInfo.GetValue(model) as System.Array; XmlElement child = CreateElementFromArray(fileInfo.GetValue(model) as System.Array, fileInfo.Name); xmlElement.AppendChild(child); } } return xmlElement; }