Beispiel #1
0
        /// <summary>
        /// Checks if the text of the specified resource can be in-place edited.
        /// </summary>
        /// <param name="res">The resource to edit.</param>
        /// <param name="text">The text that will be displayed in the in-place edit box.</param>
        /// <returns>true if the resource can be edited, false otherwise.</returns>
        public bool CanEditResourceLabel(IResource res, ref string text)
        {
            IResourceRenameHandler renameHandler = Core.PluginLoader.GetResourceRenameHandler(res);

            if (renameHandler != null)
            {
                return(renameHandler.CanRenameResource(res, ref text));
            }

            IResourceUIHandler uiHandler = Core.PluginLoader.GetResourceUIHandler(res);

            if (uiHandler != null)
            {
                return(uiHandler.CanRenameResource(res));
            }

            return(false);
        }