How to associate an event receiver with a * special content type *?

I created an event receiver and added to the GAC.

How to associate an event receiver with a specific type of custom content?

I need to do this from an XML file:

So far, I:

Feature.xml points to the Elements.xml file, but I'm not sure about the Elements.xml file.

How do you link to a specific type of content? (I have a pointer for a specific type of content)

+3
source share
2 answers

, XmlDocuments . " SharePoint" :

, XML, , elements.xml.

(...)

, , , - , , .

, . , " " " ", . , , CAML . , .

? . XmlDocuments XmlDocument. XmlDocument http://schemas.microsoft.com/sharepoint/events. XmlDocument SharePoint, ctypeswss.xml 0x010107, DocumentWorkflowItem:

<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
 <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
  <Receiver>
   <Name>Workflow Library Item Added</Name>
   <Type>ItemAdded</Type>
   <SequenceNumber>1</SequenceNumber>
   <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,~CCC
    PublicKeyToken=71e9bce111e9429c</Assembly>
   <Class>Microsoft.SharePoint.Workflow.SPWorkflowLibraryEventReceiver</Class>
   <Data />
   <Filter />
  </Receiver>
… (snipped for space saving purposes
 </Receivers>
</XmlDocument>

. spe: Receivers. , . , Receiver , . , , XmlDocument .

+8

@Larsi: . , "Inherits" true, , XmlDocuments : @ .

0

Source: https://habr.com/ru/post/1703440/


All Articles