Example #1
0
        /// <summary>
        /// Register callbacks in order to handle VLC dialogs.
        /// LibVLC 3.0.0 and later.
        /// </summary>
        /// <param name="error">Called when an error message needs to be displayed.</param>
        /// <param name="login">Called when a login dialog needs to be displayed.
        /// You can interact with this dialog by calling Dialog.PostLogin() to post an answer or Dialog.Dismiss() to cancel this dialog.</param>
        /// <param name="question">Called when a question dialog needs to be displayed.
        /// You can interact with this dialog by calling Dialog.PostLogin() to post an answer or Dialog.Dismiss() to cancel this dialog.</param>
        /// <param name="displayProgress">Called when a progress dialog needs to be displayed.</param>
        /// <param name="updateProgress">Called when a progress dialog needs to be updated.</param>
        public void SetDialogHandlers(DisplayError error, DisplayLogin login, DisplayQuestion question,
                                      DisplayProgress displayProgress, UpdateProgress updateProgress)
        {
            _error           = error ?? throw new ArgumentNullException(nameof(error));
            _login           = login ?? throw new ArgumentNullException(nameof(login));
            _question        = question ?? throw new ArgumentNullException(nameof(question));
            _displayProgress = displayProgress ?? throw new ArgumentNullException(nameof(displayProgress));
            _updateProgress  = updateProgress ?? throw new ArgumentNullException(nameof(updateProgress));

            _dialogCbs = new DialogCallbacks(Error, Login, Question, DisplayProgress, Cancel, UpdateProgress);
            Native.LibVLCDialogSetCallbacks(NativeReference, _dialogCbs, IntPtr.Zero);
        }
Example #2
0
 internal static extern void LibVLCDialogSetCallbacks(IntPtr libVLC, DialogCallbacks callbacks, IntPtr data);