kamagra how much to take

Getting A Specific SPListTemplateType Icon

MORE INFO: To answer a question I received about this, if you have a hydrated SPList you can use the SPList.BaseTemplate property as a reasonable parameter.

Unfortunately, I haven’t found a *good* way to do this. You are basically forced either to put in a grip of if statements (yuck!) or just put in a simple switch/case. Since it is boring to look up all the image names in the 12 hive, I will make your live easier for you. Just use this helper method which will consume a SPListTemplateType as a parameter. Following, it will recur through and return a string providing the path to the list icon in order to support your interface needs.

  1. public static string RetrieveListIcon(SPListTemplateType type)
  2. {
  3. switch (type)
  4. {
  5. case SPListTemplateType.DocumentLibrary:
  6. return "/_layouts/images/itdl.gif";
  7. case SPListTemplateType.Announcements:
  8. return "/_layouts/images/itann.gif";
  9. case SPListTemplateType.Events:
  10. return "/_layouts/images/itevent.gif";
  11. case SPListTemplateType.Links:
  12. return "/_layouts/images/itlink.gif";
  13. case SPListTemplateType.Tasks:
  14. return "/_layouts/images/ittask.gif";
  15. case SPListTemplateType.DiscussionBoard:
  16. return "/_layouts/images/itdisc.gif";
  17. case SPListTemplateType.PictureLibrary:
  18. return "/_layouts/images/itil.gif";
  19. case SPListTemplateType.IssueTracking:
  20. return "/_layouts/images/ITISSUE.GIF";
  21. default:
  22. return "/_layouts/images/itgen.gif";
  23. }
  24. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>