Repository: FlaxEngine/FlaxEngine
File: Source/Editor/Content/Items/ContentFolder.cs (C#)

Code before:
            return null;
        }

        /// <summary>
        /// Check if folder contains child element with given path
        /// </summary>
        /// <param name="path">Element path to find</param>
        /// <returns>True if contains that element, otherwise false</returns>
        public bool ContainsChild(string path)
        {
            return FindChild(path) != null;
        }

        /// <inheritdoc />
        public override ContentItemType ItemType => ContentItemType.Folder;

        /// <inheritdoc />
        public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Other;

        /// <inheritdoc />
        public override bool CanRename
        {
            get
            {
                var hasParentFolder = ParentFolder != null;
                var isContentFolder = IsFolder && Path == Editor.Instance.GameProject.ContentFolderPath;
                var isSourceFolder = IsFolder && Path == Editor.Instance.GameProject.SourceFolderPath;
                return hasParentFolder && !isContentFolder && !isSourceFolder;
            }
        }

        /// <inheritdoc />
        public override bool CanDrag => ParentFolder != null; // Deny rename action for root folders

        /// <inheritdoc />
        public override bool Exists => Directory.Exists(Path);

        /// <inheritdoc />
        public override string TypeDescription => "Folder";

        /// <inheritdoc />
        public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Folder128;

        /// <inheritdoc />
        internal override void UpdatePath(string value)
        {
            base.UpdatePath(value);

            ShortName = System.IO.Path.GetFileName(value);

            // Update node text

Review comment (suggestion):
This doesn't work for `Content`/`Source` in plugin/engine projects. It would be easier with:
```cs
!(Node is MainContentTreeNode)
```
`MainContentTreeNode` is created for main project folders such as Content and Source (see `ContentDatabaseModule.OnInit`).

Code after:
            return null;
        }

        /// <summary>
        /// Check if folder contains child element with given path
        /// </summary>
        /// <param name="path">Element path to find</param>
        /// <returns>True if contains that element, otherwise false</returns>
        public bool ContainsChild(string path)
        {
            return FindChild(path) != null;
        }

        /// <inheritdoc />
        public override ContentItemType ItemType => ContentItemType.Folder;

        /// <inheritdoc />
        public override ContentItemSearchFilter SearchFilter => ContentItemSearchFilter.Other;

        /// <inheritdoc />
        public override bool CanRename
        {
            get
            {
                var hasParentFolder = ParentFolder != null;
                var isContentFolder = Node is MainContentTreeNode;
                return hasParentFolder && !isContentFolder;
            }
        }

        /// <inheritdoc />
        public override bool CanDrag => ParentFolder != null; // Deny rename action for root folders

        /// <inheritdoc />
        public override bool Exists => Directory.Exists(Path);

        /// <inheritdoc />
        public override string TypeDescription => "Folder";

        /// <inheritdoc />
        public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.Folder128;

        /// <inheritdoc />
        internal override void UpdatePath(string value)
        {
            base.UpdatePath(value);

            ShortName = System.IO.Path.GetFileName(value);

            // Update node text
            Node.Text = ShortName;