コード例 #1
0
        public void HandleException(Exception exception)
        {
            string message = string.Empty;

            if (exception.InnerException != null && exception.InnerException is HubException)
            {
                message = exception.Message.ToString();
            }
            else
            {
                message = exception.ToString();
            }

            BlazorAlertsService.NewBlazorAlert(message, "Javascript Application", PositionType.Fixed);
            this.RunUpdateUI();
        }
コード例 #2
0
        public async void OnExceptionExecute(object sender, dynamic dynamicObject)
        {
            Exception   exception   = dynamicObject.Exception;
            ChatHubUser contextUser = dynamicObject.ConnectedUser;

            string message = string.Empty;

            if (exception.InnerException != null && exception.InnerException is HubException)
            {
                message = exception.InnerException.Message.Substring(exception.InnerException.Message.IndexOf("HubException"));
            }
            else
            {
                message = exception.Message;
            }

            BlazorAlertsService.NewBlazorAlert(message);
        }
コード例 #3
0
        public void HandleException(Exception exception)
        {
            string message = string.Empty;

            if (exception.InnerException != null && exception.InnerException is HubException)
            {
                int startIndex = exception.Message.IndexOf("HubException:");
                int endIndex   = exception.Message.Length - startIndex - 1;

                message = exception.Message.Substring(startIndex, endIndex);
            }
            else
            {
                message = exception.ToString();
            }

            BlazorAlertsService.NewBlazorAlert(message, "Javascript Application", PositionType.Fixed);
            this.RunUpdateUI();
        }
コード例 #4
0
        public ChatHubService(HttpClient httpClient, SiteState siteState, NavigationManager navigationManager, IJSRuntime JSRuntime, ScrollService scrollService, BlazorAlertsService blazorAlertsService, BlazorDraggableListService blazorDraggableListService, BlazorBrowserResizeService browserResizeService, BlazorVideoService blazorVideoService) : base(httpClient)
        {
            this.HttpClient                 = httpClient;
            this.SiteState                  = siteState;
            this.NavigationManager          = navigationManager;
            this.JSRuntime                  = JSRuntime;
            this.ScrollService              = scrollService;
            this.BlazorAlertsService        = blazorAlertsService;
            this.BlazorDraggableListService = blazorDraggableListService;
            this.BrowserResizeService       = browserResizeService;
            this.BlazorVideoService         = blazorVideoService;

            this.BlazorVideoService.BlazorVideoServiceExtension.OnDataAvailableEventHandler += async(string data, string id) => await OnDataAvailableEventHandlerExecute(data, id);

            this.BlazorAlertsService.OnAlertConfirmed += OnAlertConfirmedExecute;

            this.OnUpdateConnectedUserEvent           += OnUpdateConnectedUserExecute;
            this.OnAddChatHubRoomEvent                += OnAddChatHubRoomExecute;
            this.OnRemoveChatHubRoomEvent             += OnRemoveChatHubRoomExecute;
            this.OnAddChatHubUserEvent                += OnAddChatHubUserExecute;
            this.OnRemoveChatHubUserEvent             += OnRemoveChatHubUserExecute;
            this.OnAddChatHubMessageEvent             += OnAddChatHubMessageExecute;
            this.OnAddChatHubInvitationEvent          += OnAddChatHubInvitationExecute;
            this.OnRemoveChatHubInvitationEvent       += OnRemoveChatHubInvitationExecute;
            this.OnAddChatHubWaitingRoomItemEvent     += OnAddChatHubWaitingRoomItemExecute;
            this.OnRemovedChatHubWaitingRoomItemEvent += OnRemovedChathubWaitingRoomItemExecute;
            this.OnAddIgnoredUserEvent                += OnAddIngoredUserExexute;
            this.OnRemoveIgnoredUserEvent             += OnRemoveIgnoredUserExecute;
            this.OnAddIgnoredByUserEvent              += OnAddIgnoredByUserExecute;
            this.OnAddModeratorEvent        += OnAddModeratorExecute;
            this.OnRemoveModeratorEvent     += OnRemoveModeratorExecute;
            this.OnAddWhitelistUserEvent    += OnAddWhitelistUserExecute;
            this.OnRemoveWhitelistUserEvent += OnRemoveWhitelistUserExecute;
            this.OnAddBlacklistUserEvent    += OnAddBlacklistUserExecute;
            this.OnRemoveBlacklistUserEvent += OnRemoveBlacklistUserExecute;
            this.OnDownloadBytesEvent       += OnDownloadBytesExecuteAsync;
            this.OnRemoveIgnoredByUserEvent += OnRemoveIgnoredByUserExecute;
            this.OnClearHistoryEvent        += OnClearHistoryExecute;
            this.OnDisconnectEvent          += OnDisconnectExecute;

            GetLobbyRoomsTimer.Elapsed += new ElapsedEventHandler(OnGetLobbyRoomsTimerElapsed);
            GetLobbyRoomsTimer.Interval = 10000;
            GetLobbyRoomsTimer.Enabled  = true;
        }
コード例 #5
0
        public ChatHubService(HttpClient httpClient, SiteState siteState, NavigationManager navigationManager, IJSRuntime JSRuntime, VideoService videoService, ScrollService scrollService, BlazorAlertsService blazorAlertsService, BlazorDraggableListService blazorDraggableListService, BrowserResizeService browserResizeService) : base(httpClient)
        {
            this.HttpClient                 = httpClient;
            this.SiteState                  = siteState;
            this.NavigationManager          = navigationManager;
            this.JSRuntime                  = JSRuntime;
            this.VideoService               = videoService;
            this.ScrollService              = scrollService;
            this.BlazorAlertsService        = blazorAlertsService;
            this.BlazorDraggableListService = blazorDraggableListService;
            this.BrowserResizeService       = browserResizeService;

            this.VideoService.VideoServiceExtension.OnDataAvailableEventHandler += async(object sender, dynamic e) => await OnDataAvailableEventHandlerExecute(e.dataURI, e.roomId, e.dataType);

            this.VideoService.VideoServiceExtension.OnPauseLivestreamTask += (object sender, int e) => OnPauseLivestreamTaskExecute(sender, e);
            this.VideoService.OnContinueLivestreamTask += (object sender, int e) => OnContinueLivestreamTaskExecute(sender, e);

            this.OnUpdateConnectedUserEvent     += OnUpdateConnectedUserExecute;
            this.OnAddChatHubRoomEvent          += OnAddChatHubRoomExecute;
            this.OnRemoveChatHubRoomEvent       += OnRemoveChatHubRoomExecute;
            this.OnAddChatHubUserEvent          += OnAddChatHubUserExecute;
            this.OnRemoveChatHubUserEvent       += OnRemoveChatHubUserExecute;
            this.OnAddChatHubMessageEvent       += OnAddChatHubMessageExecute;
            this.OnAddChatHubInvitationEvent    += OnAddChatHubInvitationExecute;
            this.OnRemoveChatHubInvitationEvent += OnRemoveChatHubInvitationExecute;
            this.OnAddIgnoredUserEvent          += OnAddIngoredUserExexute;
            this.OnRemoveIgnoredUserEvent       += OnRemoveIgnoredUserExecute;
            this.OnAddIgnoredByUserEvent        += OnAddIgnoredByUserExecute;
            this.OnAddModeratorEvent            += OnAddModeratorExecute;
            this.OnRemoveModeratorEvent         += OnRemoveModeratorExecute;
            this.OnAddWhitelistUserEvent        += OnAddWhitelistUserExecute;
            this.OnRemoveWhitelistUserEvent     += OnRemoveWhitelistUserExecute;
            this.OnAddBlacklistUserEvent        += OnAddBlacklistUserExecute;
            this.OnRemoveBlacklistUserEvent     += OnRemoveBlacklistUserExecute;
            this.OnDownloadBytes            += OnDownloadBytesExecuteAsync;
            this.OnRemoveIgnoredByUserEvent += OnRemoveIgnoredByUserExecute;
            this.OnClearHistoryEvent        += OnClearHistoryExecute;
            this.OnDisconnectEvent          += OnDisconnectExecute;

            GetLobbyRoomsTimer.Elapsed += new ElapsedEventHandler(OnGetLobbyRoomsTimerElapsed);
            GetLobbyRoomsTimer.Interval = 10000;
            GetLobbyRoomsTimer.Enabled  = true;
        }