コード例 #1
0
        private NotifyKioskDto AddNotification(string machineId, ProcessType processType, KioskStatus kioskStatus, string systemName, string groupName)
        {
            if (SettingsConfigurationSignalR.IS_PULSE_SERVER)
            {
                var events = new SignalREventHandlers(Context.QueryString["access_token"]);

                AsyncHelper.RunSync(() => events.TriggerUpdateStatusAsync(new KioskArgs
                {
                    MachineId   = machineId,
                    kioskStatus = kioskStatus
                }));

                var document = AsyncHelper.RunSync(() => events.TriggerNofityAsync(new NotifyKioskArgs
                {
                    MachineId = machineId,
                    Name      = systemName,
                    GroupName = groupName,
                    Status    = Enum.GetName(typeof(KioskStatus), kioskStatus),
                    Content   = string.Format("Kiosk {0} {1} to Pulse Server.", systemName, Enum.GetName(typeof(ProcessType), processType)),
                    CreateAt  = DateTime.UtcNow
                }));

                return(document);
            }

            return(null);
        }