//================================================================================================ void FunctionBT_Main(Collider other) { if (!DataMenu.bCreateName && !DataMenu.bMakeAlert) { if (DataMenu.CheckTriger(other)) { GetComponent <Renderer>().material = DataMenu.mMain[2]; if (this.gameObject.name.Equals("ButtonCreateName")) { MakeKeyBoard(); } else if (this.gameObject.name.Equals("ButtonPlay")) { PlayGame(); } else if (this.gameObject.name.Equals("ButtonQuit")) { Application.Quit(); } else if (this.gameObject.name.Equals("ButtonHTP")) { //Destroy(gPlayer.gameObject); SceneManager.LoadScene("How to play game"); } } else { this.gameObject.GetComponent <Renderer>().material = DataMenu.mMain[1]; } } }
private void Set(object _data) { DataMenu data = _data as DataMenu; DragObjectDrawer.methodUpdateIfRequiredOrScript.Invoke(data.property.serializedObject, null); // #UNITY_MULTI_VERSION data.property.objectReferenceValue = data.target; data.property.serializedObject.ApplyModifiedProperties(); }
private DataMenu AddMenu(List <DataMenu> result, string title, string tooltip, DataMenuType type, DP_DataView dataItem) { var dataMenu = new DataMenu(); dataMenu.Title = title; dataMenu.Tooltip = tooltip; dataMenu.Type = type; dataMenu.DataItem = dataItem; result.Add(dataMenu); return(dataMenu); }
//================================================================================================ void FunctionBT_KeyBoard(Collider other) { if (DataMenu.CheckTriger(other) && fTime <= 0f) { //Debug.Log(this.gameObject.name); fTime = 0.3f; if (this.gameObject.name.Length == 1) { this.GetComponent <Renderer>().material = DataMenu.mKeyBoard[2]; //Debug.Log("Use SelectChar()"); SelectChar(); } else if (this.gameObject.name.Equals("Remove")) { this.GetComponent <Renderer>().material = mRemove[2]; //Debug.Log("Use RemoveChar()"); RemoveChar(); } else if (this.gameObject.name.Equals("Select")) { this.GetComponent <Renderer>().material = DataMenu.mMain[2]; //Debug.Log("Use SelectName()"); SelectName(); } else if (this.gameObject.name.Equals("Exit")) { this.GetComponent <Renderer>().material = DataMenu.mMain[2]; //Debug.Log("Use ExitKeyBoard()"); ExitKeyBoard(); } } else { if (this.gameObject.name.Equals("Remove")) { this.GetComponent <Renderer>().material = mRemove[1]; } else if (this.gameObject.name.Length == 1) { this.GetComponent <Renderer>().material = DataMenu.mKeyBoard[1]; } else { this.GetComponent <Renderer>().material = DataMenu.mMain[1]; } } }
private void DropObject(object o) { DataMenu data = o as DataMenu; data.position.x = 18F; data.position.y = data.offset * 18F; GameObject gameObject = data.target as GameObject; if (gameObject == null) { Component c = data.target as Component; if (c != null) { gameObject = c.gameObject; } } if (gameObject != null) { if (typeof(GameObject).IsAssignableFrom(this.fieldInfo.FieldType) == true) { data.property.objectReferenceValue = gameObject; data.property.serializedObject.ApplyModifiedProperties(); } else { Type safeType = this.fieldInfo.FieldType; if (typeof(Component).IsAssignableFrom(safeType) == false) { safeType = typeof(Component); } Component[] components = gameObject.GetComponents(safeType); if (components.Length == 1 && this.fieldInfo.FieldType != typeof(Object)) { data.property.objectReferenceValue = components[0]; data.property.serializedObject.ApplyModifiedProperties(); } else { this.DropDownMultiComponents(data.position, gameObject, this.fieldInfo.FieldType, data.property, true); } } } }
//public List<DataMenuSettingDTO> GetDataMenusOfRelationship(DR_Requester requester, int relationshipID) //{ // List<EntitySearchableReportDTO> result = new List<EntitySearchableReportDTO>(); // using (var projectContext = new DataAccess.MyProjectEntities()) // { // BizRelationship bizRelationship = new BizRelationship(); // var relationship = bizRelationship.GetRelationship(requester, relationshipTailID); // return GetDataMenuSettings(requester, relationshipTail.TargetEntityID); // } //} private DataMenu GetGroupMenu(DataMenu parentMenu, string key) { if (string.IsNullOrEmpty(key)) { return(parentMenu); } else { if (parentMenu.SubMenus.Any(x => x.Title == key)) { return(parentMenu.SubMenus.First(x => x.Title == key)); } else { var subMenu = AddMenu(parentMenu.SubMenus, key, "", DataMenuType.Folder, null); return(subMenu); } } }
public MainMenuMasterViewModel() { Data = new DataMenu(); MenuItems = Data.MainMenuItems; }
private async void ListMenuOnItemTapped(object sender, ItemTappedEventArgs itemTappedEventArgs) { DataMenu data = (DataMenu)itemTappedEventArgs.Item; switch (data.id) { case 0: await App.NavigateMasterDetail(new PageTramVTGanDay()); break; case 1: await App.NavigateMasterDetail(new PageKetCuoiGanDay()); break; case 2: await App.NavigateMasterDetail(new PageDichVuKhaDung()); break; case 3: await App.NavigateMasterDetail(new PageTraCuuThueBao()); break; case 4: var smsMessenger = MessagingPlugin.SmsMessenger; if (smsMessenger.CanSendSms) { smsMessenger.SendSms("+84", "Bạn đang ở địa chỉ: " + Initial.PositionName + ". Có tọa độ (Lat,Long)=(" + Initial.PositionNow.Latitude + "," + Initial.PositionNow.Longitude + ")"); } else { await Application.Current.MainPage.DisplayAlert("Thông báo", "Thiết bị của bạn không hỗ trợ thực hiện gửi SMS", "Ok"); } break; case 5: var answer = await Application.Current.MainPage.DisplayAlert("Thông báo", "Bạn có chắc đăng xuất không?", "Yes", "No"); if (answer) { App.Current.MainPage = new PageLogin(); } break; case 6: //var PhoneCallTask = MessagingPlugin.PhoneDialer; //if (PhoneCallTask.CanMakePhoneCall) // PhoneCallTask.MakePhoneCall("01234445079"); //else // await Application.Current.MainPage.DisplayAlert("Thông báo", "Thiết bị của bạn không hỗ trợ thực hiện cuộc gọi", "Ok"); await App.NavigateMasterDetail(new Pagetest()); break; default: break; } }
public DataMenuResult GetDataMenu(DR_Requester requester, DP_DataView dataItem, int dataMenuSettingID) { DataMenuResult result = new DataMenuResult(); List <DataMenu> resultMenus = new List <DataMenu>(); result.DataMenus = resultMenus; var entityID = dataItem.TargetEntityID; var simpleEntity = bizTableDrivedEntity.GetSimpleEntity(requester, entityID); if (simpleEntity == null) { return(null); } DataMenuSettingDTO dataMenuSetting = null; if (dataMenuSettingID != 0) { dataMenuSetting = GetDataMenuSetting(requester, dataMenuSettingID, true); } else { dataMenuSetting = GetDefaultDataMenuSetting(requester, entityID, true); } if (dataMenuSetting != null) { result.DataMenuSettingName = dataMenuSetting.Name; } if (simpleEntity.IsView) { if (dataMenuSetting != null) { if (dataMenuSetting.RelationshipID != 0 && dataMenuSetting.TargetDataMenuSettingID != 0) { var relationship = bizRelationship.GetRelationship(dataMenuSetting.RelationshipID); var dataView = CreateDataView(requester, dataItem, relationship); return(GetDataMenu(requester, dataView, dataMenuSetting.TargetDataMenuSettingID)); } } //var fullEntity = bizTableDrivedEntity.GetTableDrivedEntity(requester, entityID, EntityColumnInfoType.WithSimpleColumns, EntityRelationshipInfoType.WithRelationships); //if (fullEntity.Relationships.Any()) //{ // foreach (var relationsip in fullEntity.Relationships) // { // var dataView = CreateDataView(dataItem, relationsip); // var menu = AddMenu(result, relationsip.Alias, "", DataMenuType.ViewRel); // menu.ViewRelTargetDataItem = dataView; // } //} } else { var dataEntryRootMenu = AddMenu(resultMenus, "نمایش/اصلاح داده", "", DataMenuType.Form, dataItem); //آرشیو داده // BizArchive bizArchive = new BizArchive(); if (bizTableDrivedEntity.DataIsAccessable(requester, entityID, new List <SecurityAction>() { SecurityAction.ArchiveView, SecurityAction.ArchiveEdit })) { var archiveRootMenu = AddMenu(resultMenus, "آرشیو", "", DataMenuType.Archive, dataItem); } //نامه های داده // BizLetterTemplate bizLetterTemplate = new BizLetterTemplate(); if (bizTableDrivedEntity.DataIsAccessable(requester, entityID, new List <SecurityAction>() { SecurityAction.LetterView, SecurityAction.LetterEdit })) { var letterRootMenu = AddMenu(resultMenus, "نامه ها", "", DataMenuType.Letter, dataItem); } //جریان کارهای مرتبط if (bizProcess.EntityHasAnyProcess(entityID)) { var workflowRootMenu = AddMenu(resultMenus, "جریان کار", "", DataMenuType.Workflow, dataItem); } ////لینک های داده //BizDataLink bizDataLink = new MyModelManager.BizDataLink(); //var datalinks = bizDataLink.GetDataLinkByEntitiyID(requester, entityID); //if (datalinks.Any()) //{ // var dataViewRootMenu = AddMenu(resultMenus, "لینک داده", "", DataMenuType.Folder,null); // foreach (var datalink in datalinks) // { // var datalinkMenu = AddMenu(dataViewRootMenu.SubMenus, datalink.ReportTitle, "", DataMenuType.DataLink, dataItem); // datalinkMenu.Datalink = datalink; // } //} //گزارشهای داده های مرتبط if (dataMenuSetting != null) { if (dataMenuSetting.SearchableReportRelationships.Any()) { var relationshipReportRootMenu = AddMenu(resultMenus, "گزارش داده های مرتبط", "", DataMenuType.Folder, null); foreach (var group in dataMenuSetting.SearchableReportRelationships.GroupBy(x => x.Group1 ?? "")) { DataMenu parentGroupMenu = GetGroupMenu(relationshipReportRootMenu, group.Key); foreach (var rel in group) { var menu = AddMenu(parentGroupMenu.SubMenus, rel.SearchableReportReport.ReportTitle, "", DataMenuType.RelationshipTailSearchableReport, dataItem); menu.SearchableReportRelationshipTail = rel; } } } //نمای داده های مرتبط if (dataMenuSetting.DataViewRelationships.Any()) { var dataViewRootMenu = AddMenu(resultMenus, "نمایش داده های مرتبط", "", DataMenuType.Folder, null); foreach (var group in dataMenuSetting.DataViewRelationships.GroupBy(x => x.Group1 ?? "")) { DataMenu parentGroupMenu = GetGroupMenu(dataViewRootMenu, group.Key); foreach (var rel in group) { var dataViewRelMenu = AddMenu(parentGroupMenu.SubMenus, rel.RelationshipTail.TargetEntityAlias, rel.RelationshipTail.EntityPath, DataMenuType.RelationshipTailDataView, dataItem); dataViewRelMenu.DataviewRelationshipTail = rel.RelationshipTail; dataViewRelMenu.TargetDataMenuSettingID = rel.TargetDataMenuSettingID; } } } if (dataMenuSetting.GridViewRelationships.Any()) { var gridViewRootMenu = AddMenu(resultMenus, "گرید داده های مرتبط", "", DataMenuType.Folder, null); foreach (var group in dataMenuSetting.GridViewRelationships.GroupBy(x => x.Group1 ?? "")) { DataMenu parentGroupMenu = GetGroupMenu(gridViewRootMenu, group.Key); foreach (var rel in group) { var gridViewRelMenu = AddMenu(parentGroupMenu.SubMenus, rel.RelationshipTail.TargetEntityAlias, rel.RelationshipTail.EntityPath, DataMenuType.RelationshipTailDataGrid, dataItem); gridViewRelMenu.GridviewRelationshipTail = rel.RelationshipTail; gridViewRelMenu.TargetDataMenuSettingID = rel.TargetDataMenuSettingID; } } } if (dataMenuSetting.DataItemReports.Any()) { var gridViewRootMenu = AddMenu(resultMenus, "گزارشات مورد داده", "", DataMenuType.Folder, null); foreach (var group in dataMenuSetting.DataItemReports.GroupBy(x => x.Group1 ?? "")) { DataMenu parentGroupMenu = GetGroupMenu(gridViewRootMenu, group.Key); foreach (var rel in group) { var gridViewRelMenu = AddMenu(parentGroupMenu.SubMenus, rel.EntityDataItemReport.ReportTitle, "", DataMenuType.DataItemReport, dataItem); gridViewRelMenu.DataItemReport = rel.EntityDataItemReport; } } } } } return(result); }