public async Task <TreeUI?> GetTreeAsync(string alias, string?parentId) { var collection = _collectionProvider.GetCollection(alias); var testEntity = await collection.Repository.InternalNewAsync(parentId, collection.EntityVariant.Type); var viewAuthorizationChallenge = await _authorizationService.AuthorizeAsync( _httpContextAccessor.HttpContext.User, testEntity, Operations.Read); var editAuthorizationChallenge = await _authorizationService.AuthorizeAsync( _httpContextAccessor.HttpContext.User, testEntity, Operations.Update); var tree = new TreeUI { Alias = collection.Alias, Name = collection.Name, EntitiesVisible = collection.TreeView?.EntityVisibility == EntityVisibilty.Visible, RootVisible = collection.TreeView?.RootVisibility == CollectionRootVisibility.Visible, Icon = "list" }; if (collection.ListEditor != null && editAuthorizationChallenge.Succeeded) { tree.Path = UriHelper.Collection(Constants.Edit, collection.Alias, parentId); } else if (collection.ListView != null && viewAuthorizationChallenge.Succeeded) { tree.Path = UriHelper.Collection(Constants.List, collection.Alias, parentId); } return(tree); }
public GameObject TreeUICreate() { var tree_ui = Instantiate(Resources.Load <GameObject>("UI/Popup/TreeUI") as GameObject); tree_ui.transform.parent = canvas.transform; tree_ui.GetComponent <RectTransform>().anchorMin = new Vector2(1, 1); tree_ui.GetComponent <RectTransform>().anchorMax = new Vector2(1, 1); tree_ui.GetComponent <RectTransform>().pivot = new Vector2(0.5f, 0.5f); tree_ui.GetComponent <RectTransform>().anchoredPosition = new Vector3(-204.65f, -53.64998f, 0f); ui_tree = tree_ui.GetComponent <TreeUI>(); return(tree_ui); }
public void TreeNameSet() { treeUI = FindObjectOfType <UISystem>().ui_tree; if (tree_type == TreeType.AppleTree) { treeUI.TreeName("사과 나무"); } else if (tree_type == TreeType.BananaTree) { treeUI.TreeName("바나나 나무"); } else if (tree_type == TreeType.CoconutTree) { treeUI.TreeName("코코넛 나무"); } }
public async Task <TreeUI?> GetTreeAsync(string alias, ParentPath?parentPath) { var collection = _collectionProvider.GetCollection(alias); if (collection == null) { throw new InvalidOperationException($"Failed to get collection for given alias ({alias})."); } var parent = await _parentService.GetParentAsync(parentPath); var testEntity = await collection.Repository.NewAsync(parent, collection.EntityVariant.Type); var viewAuthorizationChallenge = await _authorizationService.AuthorizeAsync( _httpContextAccessor.HttpContext.User, testEntity, Operations.Read); var editAuthorizationChallenge = await _authorizationService.AuthorizeAsync( _httpContextAccessor.HttpContext.User, testEntity, Operations.Update); var tree = new TreeUI { Alias = collection.Alias, Name = collection.Name, EntitiesVisible = collection.TreeView?.EntityVisibility == EntityVisibilty.Visible, RootVisible = collection.TreeView?.RootVisibility == CollectionRootVisibility.Visible, Icon = collection.Icon ?? "list" }; if (collection.ListEditor != null && editAuthorizationChallenge.Succeeded) { tree.Path = UriHelper.Collection(Constants.Edit, collection.Alias, parentPath); } else if (collection.ListView != null && viewAuthorizationChallenge.Succeeded) { tree.Path = UriHelper.Collection(Constants.List, collection.Alias, parentPath); } return(tree); }
public void TreeHpSet() { treeUI = FindObjectOfType <UISystem>().ui_tree; treeUI.ImageFill(tree_hp); }
/// <summary> /// Sets the L&F object that renders this component. /// </summary> public void setUI(TreeUI @ui) { }
private void Awake() { instance = this; }