Default Display Name in Web Resources Manager

Nov 14, 2013 at 7:30 AM
First of all: "Great Toolkit!" I thought it would be nice, if the WRM could create a default display name for resources loaded from file.

I inserted the following code to the TreeViewHelper, maybe you can make use of it or add an option to select if and how a display name should be generated.

A "refresh" button to reload the resources from the file path would also be great!

Kind regards
Markus
173            // Create new virtual web resource
174            var script = new Entity("webresource");
175            script["name"] = fileName;
176            
177            /**
178             * <edit
179             *   author = "Markus Wolff"
180             *   date = "2013-11-13"
181             *   description = "generate display name from filename">
182             */
183            var lastSlash = fileName.LastIndexOf("/", StringComparison.Ordinal);
184            var displayName = lastSlash > -1
185                ? fileName.Substring(lastSlash + 1)
186                : fileName;
187            script["displayname"] = displayName;
188            /**
189             * </edit>
190             */ 
191
192            script["webresourcetype"] = new OptionSetValue(imageIndex - 1);
193
194            // Add content
195            script["content"] = Convert.ToBase64String(File.ReadAllBytes(fiChild.FullName));
Coordinator
Nov 14, 2013 at 7:38 AM
Hi badhabits,

Thank you for the feedback, I will add these two features