PageRenderTime 34ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/Main/SPALM.SharePointSoftwareFactory/Snippets/CSharp/SharePoint Software Factory 2010/ListItems/Create a list item.snippet

#
Unknown | 50 lines | 50 code | 0 blank | 0 comment | 0 complexity | 2dded955747a25cf0c173d3d9b5b2240 MD5 | raw file
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3. <CodeSnippet Format="1.0.0">
  4. <Header>
  5. <SnippetTypes>
  6. <SnippetType>Expansion</SnippetType>
  7. </SnippetTypes>
  8. <Title>Create a list item</Title>
  9. <Author>Ayman El-Hattab http://ayman-elhattab.blogspot.com
  10. </Author>
  11. <Description>
  12. </Description>
  13. <HelpUrl>http://SPCodeSnippets.codeplex.com</HelpUrl>
  14. <Shortcut>
  15. </Shortcut>
  16. </Header>
  17. <Snippet>
  18. <Declarations>
  19. <Literal Editable="true">
  20. <ID>MyTitle</ID>
  21. <ToolTip>Item title</ToolTip>
  22. <Default>MyTitle</Default>
  23. <Function>
  24. </Function>
  25. </Literal>
  26. <Object Editable="true">
  27. <ID>item</ID>
  28. <ToolTip>SPListItem</ToolTip>
  29. <Default>item</Default>
  30. <Function>
  31. </Function>
  32. <Type>SPListItem</Type>
  33. </Object>
  34. <Object Editable="true">
  35. <ID>list</ID>
  36. <ToolTip>SPList</ToolTip>
  37. <Default>list</Default>
  38. <Function>
  39. </Function>
  40. <Type>SPList</Type>
  41. </Object>
  42. </Declarations>
  43. <Code Language="csharp"><![CDATA[
  44. SPListItem $item$ = $list$.Items.Add();
  45. $item$["Title"] = " $MyTitle$";
  46. $item$.Update();
  47. ]]></Code>
  48. </Snippet>
  49. </CodeSnippet>
  50. </CodeSnippets>