拷贝customList修改 O(∩_∩)O
也可以参考:
http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/40076dc2-8be6-4019-bf1e-54067880e8a8/
Instead of creating the feature to associate with all custom lists, you want to create the feature to only work with specific types of lists? Lists that you create? Then you'll need to associate the feature with your list type instead of the built-in list types.
For this, you'll need to create a feature with (at least) two elements: one to create a new List Template with a unique type, and one to create the custom ECB item that's activated for this unique type.
If you copy the CustomList feature to a new feature, then you can start here.
<Elements xmlns=" http://schemas.microsoft.com/sharepoint/">
<ListTemplate
Name="MyCustomList"
Type=" ListTemplateType"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="My Custom List"
Description="My Custom List"
Image="/_layouts/images/itgen.gif"/>
</Elements>
For the ListTemplateType field , choose a unique identifying integer (different that what's listed below)
public enum SPListTemplateType
{
InvalidType = -1,
GenericList = 100,
DocumentLibrary = 101,
Survey = 102,
Links = 103,
Announcements = 104,
Contacts = 105,
Events = 106,
Tasks = 107,
DiscussionBoard = 108,
PictureLibrary = 109,
DataSources = 110,
WebTemplateCatalog = 111,
UserInformation = 112,
WebPartCatalog = 113,
ListTemplateCatalog = 114,
XMLForm = 115,
MasterPageCatalog = 116,
NoCodeWorkflows = 117,
WorkflowProcess = 118,
WebPageLibrary = 119,
CustomGrid = 120,
DataConnectionLibrary = 130,
WorkflowHistory = 140,
GanttTasks = 150,
Meetings = 200,
Agenda = 201,
MeetingUser = 202,
Decision = 204,
MeetingObjective = 207,
TextBox = 210,
ThingsToBring = 211,
HomePageLibrary = 212,
Posts = 301,
Comments = 302,
Categories = 303,
IssueTracking = 1100,
AdminTasks = 1200,
}
Finally, for your custom action, use the ListTemplateId. This will allow the ECB item to only appear in these list types. If you create additional lists based on this template, these lists will also have the custom ECB item appear.
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="Litware.MyCustomList"
RegistrationType="List"
RegistrationId="ListTemplateType"
ImageUrl="/_layouts/images/GORTL.GIF"
Location="EditControlBlock"
Sequence="300"
Title="View Additional Information" >
<UrlAction Url..." />
</CustomAction>
</Elements>