public void ShowName(string _name, BookItemType _type) { this.Name.gameObject.SetActive(true); this.Type.gameObject.SetActive(true); this.Name.text = LanguageManager.Instance.GetStringById(_name); this.Type.text = this.DisplayTypeName(_type); }
/// <summary> /// Clone a book item under a new parent and with a new type. /// </summary> /// <param name="newParent">The new parent item.</param> /// <param name="newType">The new type.</param> /// <returns>The cloned book item.</returns> /// <remarks> /// <para>The cloned item shares its <see cref="Items"/> collection with the source item.</para> /// <para>The cloned item is *not* added to the new parent.</para> /// </remarks> public BookItem Clone(BookItem newParent, BookItemType newType) { return(new BookItem(newParent, newType, Path, Items) { Header = Header }); }
/// <summary> /// Initializes a new instance of the <see cref="BookItem"/> class with a parent item. /// </summary> /// <param name="parent">A parent item, or <c>null</c> for root items.</param> /// <param name="type">The book item type.</param> /// <param name="path">The path of the solution.</param> /// <param name="items">The child items.</param> private BookItem(BookItem parent, BookItemType type, string path, ObservableCollection <BookItem> items) { Items = items; Parent = parent; Type = type; Path = path; }
/// <summary> /// Initializes a new instance of the <see cref="BookItem"/> class with a parent item. /// </summary> /// <param name="parent">A parent item, or <c>null</c> for root items.</param> /// <param name="type">The book item type.</param> /// <param name="path">The path of the solution.</param> public BookItem(BookItem parent, BookItemType type, string path = null) : this(parent, type, path, new ObservableCollection <BookItem>()) { }