コード例 #1
0
        private SPModelProvisionEventReceiver GetProvisionEventReceiver(bool includeInterfaces)
        {
            SPModelProvisionMulticastEventReceiver eventReceivers = new SPModelProvisionMulticastEventReceiver();

            if (this.Parent != null)
            {
                eventReceivers.Add(this.Parent.GetProvisionEventReceiver(false));
            }
            foreach (SPModelDescriptor descriptor in this.Interfaces)
            {
                eventReceivers.Add(descriptor.GetProvisionEventReceiver(false));
            }
            if (provisionEventReceiverType != null)
            {
                eventReceivers.Add((SPModelProvisionEventReceiver)provisionEventReceiverType.CreateInstance());
            }
            if (eventReceivers.Count > 1)
            {
                return(eventReceivers);
            }
            if (eventReceivers.Count == 1)
            {
                return(eventReceivers[0]);
            }
            return(SPModelProvisionEventReceiver.Default);
        }
コード例 #2
0
 public void Add(SPModelProvisionEventReceiver eventReceiver)
 {
     if (eventReceiver != SPModelProvisionEventReceiver.Default)
     {
         SPModelProvisionMulticastEventReceiver multicastReceiver = eventReceiver as SPModelProvisionMulticastEventReceiver;
         if (multicastReceiver != null)
         {
             eventReceivers.AddRange(multicastReceiver.eventReceivers);
         }
         else
         {
             eventReceivers.Add(eventReceiver);
         }
     }
 }