public void Post(IBroadcastEvent broadcastEvent) { lock (events) { events.Enqueue(broadcastEvent); } }
private MessageDeliveryType GetDeliveryType(IBroadcastEvent broadcastEvent) { MessageDeliveryType deliveryType = broadcastEvent.deliveryType; if (deliveryType == MessageDeliveryType.Unspecified) { return(defaultDeliveryType); } return(deliveryType); }
private void RegisterClient(IFilterGraph ifg) { int hr; object o; DirectShowLib.IServiceProvider spServiceProvider; // Get the service provider interface spServiceProvider = ifg as DirectShowLib.IServiceProvider; hr = spServiceProvider.QueryService(SID_SBroadcastEventService, typeof(IBroadcastEvent).GUID, out o); m_pService = o as IBroadcastEvent; // Register ourselves as a client IConnectionPoint icp = m_pService as IConnectionPoint; icp.Advise(this, out m_Cookie); }
public void Post(IBroadcastEvent broadcastEvent) { MessageDeliveryType deliveryType = GetDeliveryType(broadcastEvent); switch (deliveryType) { case MessageDeliveryType.Immediate: broadcastEvent.DeliverEvent(); break; case MessageDeliveryType.FixedUpdate: lock (events) events.Enqueue(broadcastEvent); break; case MessageDeliveryType.Unspecified: default: throw new ArgumentOutOfRangeException($"Invalid delivery type: {deliveryType}"); } }
internal void Post(IBroadcastEvent engineEvent) { eventsManager.Post(engineEvent); }
public void Post(IBroadcastEvent engineEvent) { Assert.IsNotNull(engineEvent); events.Enqueue(engineEvent); }