private void SafeInvokeRecordingStopped()
        {
            if (RecordingStopped == null)
            {
                return;         //No Listeners
            }
            RecordingStoppedEvent listener = null;

            Delegate[] dels = RecordingStopped.GetInvocationList();

            foreach (Delegate del in dels)
            {
                try
                {
                    listener = (RecordingStoppedEvent)del;
                    listener.Invoke();
                }
                catch (Exception)
                {
                    //Could not reach the destination, so remove it
                    //from the list
                    RecordingStopped -= listener;
                }
            }
        }
Ejemplo n.º 2
0
    // Private static methods

    private static void RemoveAllEventHandlers()
    {
        if (WasClosed != null)
        {
            foreach (Everyplay.WasClosedDelegate del in WasClosed.GetInvocationList())
            {
                WasClosed -= del;
            }
        }

        if (ReadyForRecording != null)
        {
            foreach (Everyplay.ReadyForRecordingDelegate del in ReadyForRecording.GetInvocationList())
            {
                ReadyForRecording -= del;
            }
        }

        if (RecordingStarted != null)
        {
            foreach (Everyplay.RecordingStartedDelegate del in RecordingStarted.GetInvocationList())
            {
                RecordingStarted -= del;
            }
        }

        if (RecordingStopped != null)
        {
            foreach (Everyplay.RecordingStoppedDelegate del in RecordingStopped.GetInvocationList())
            {
                RecordingStopped -= del;
            }
        }

        if (FaceCamSessionStarted != null)
        {
            foreach (Everyplay.FaceCamSessionStartedDelegate del in FaceCamSessionStarted.GetInvocationList())
            {
                FaceCamSessionStarted -= del;
            }
        }

        if (FaceCamRecordingPermission != null)
        {
            foreach (Everyplay.FaceCamRecordingPermissionDelegate del in FaceCamRecordingPermission.GetInvocationList())
            {
                FaceCamRecordingPermission -= del;
            }
        }

        if (FaceCamSessionStopped != null)
        {
            foreach (Everyplay.FaceCamSessionStoppedDelegate del in FaceCamSessionStopped.GetInvocationList())
            {
                FaceCamSessionStopped -= del;
            }
        }

        if (ThumbnailReadyAtFilePath != null)
        {
            foreach (Everyplay.ThumbnailReadyAtFilePathDelegate del in ThumbnailReadyAtFilePath.GetInvocationList())
            {
                ThumbnailReadyAtFilePath -= del;
            }
        }

        if (ThumbnailReadyAtTextureId != null)
        {
            foreach (Everyplay.ThumbnailReadyAtTextureIdDelegate del in ThumbnailReadyAtTextureId.GetInvocationList())
            {
                ThumbnailReadyAtTextureId -= del;
            }
        }

        if (UploadDidStart != null)
        {
            foreach (Everyplay.UploadDidStartDelegate del in UploadDidStart.GetInvocationList())
            {
                UploadDidStart -= del;
            }
        }

        if (UploadDidProgress != null)
        {
            foreach (Everyplay.UploadDidProgressDelegate del in UploadDidProgress.GetInvocationList())
            {
                UploadDidProgress -= del;
            }
        }

        if (UploadDidComplete != null)
        {
            foreach (Everyplay.UploadDidCompleteDelegate del in UploadDidComplete.GetInvocationList())
            {
                UploadDidComplete -= del;
            }
        }
    }