I've programatically created ContentType based on document set and want to attach event receiver to it. Looks something like this:
SPEventReceiverDefinition eventReceiverDefinition = TestDocumentSet.EventReceivers.Add();
eventReceiverDefinition.Class = "DocSetsTesting.EventReceivers.DocSetReceiver.DocSetReceiver"; // String
eventReceiverDefinition.Assembly = Assembly.GetExecutingAssembly().FullName; // String
eventReceiverDefinition.Type = SPEventReceiverType.ItemAdded; // SPEventReceiverType
eventReceiverDefinition.Data = "XML"; // Arbitrary input data (String)
eventReceiverDefinition.Update();
When I do this for ItemAdding event, handler works. But it won't work for ItemAdded. I do all this stuff because I want to make files with specific content types hidden, so I want them not to be showed in the Document Set Contents Web Part. Is it possible at all? And may be there is a simpler way to do this? Thanks a lot.