public AmivoiceWatcher() { try { Globals.log.Debug("/"); Globals.log.Debug("/"); Globals.log.Debug("/"); Globals.log.Debug("/"); Globals.log.Debug("Welcome to Amivoice Watcher v" + ComputerInfo.WatcherVersion); #if DEBUG Console.WriteLine("Mode=Debug"); //DebugHelper(); #endif FormWaiting.ShowSplashScreen(); Configuration.Initialize(); InitializeCefsharp(); InitializeFormCefsharpDummy(); //CefsharpOffscreen.MyInitialize(); //MainForm mainForm = new MainForm(); //this takes ages //FormWaiting.CloseForm(); //Application.Run(mainForm); Globals.CreateAllDirectoryAndFiles(); InitializeTrayMenu(); if (Configuration.CheckEnableAgentActivity()) { threadUserActivity = new Thread(new ThreadStart(UserActivityThread.ThreadMain)); threadUserActivity.Start(); } threadComputerInfo = new Thread(new ThreadStart(ComputerInfo.ThreadMain)); threadComputerInfo.Start(); // Will be start by FormNotificationPanel threadRabbitMQ = new Thread(new ThreadStart(RabbitMQWrapper.ThreadMain)); threadRabbitMQ.Start(); SendComputerLogStartup_by_myFormCefsharpDummy(); NotificationPanel._init(); #if DEBUG //Globals.Notifications.PopupWelcomeMessage(); #endif //DONT DELETE //StartCaptureScreenRecord(); } catch (Exception e) { Globals.log.Error(e.ToString()); } }
public void Should_Update_NotificationPanel() { NotificationPanel notificationPanel = new NotificationPanel(userId, title, content, notificationSettingId, link, branchId, committeeId); notificationPanel.Update(NotifacationStatus.Send); Assert.Equal((int)NotifacationStatus.Send, notificationPanel.NotifacationStatusId); }
void Start() { _towerExist = false; _confirmed = false; _towerIndex = -1; _clearBeforeBattle = false; _currentTowerType = -1; _levelManager = GameManager.Instance.CurrentLevelManager; _gameBoard = _levelManager.GameBoardSystem; _towerController = TowerController.Instance; _towerBuildPanel = TowerBuildPanel.Instance; _towerOperationPanel = TowerOperationPanel.Instance; _towerInfoPanel = TowerInfoPanel.Instance; _buildCheckPanel = BuildCheckPanel.Instance; _notificationPanel = NotificationPanel.Instance; _tankTowerButton = TankTowerButton.Instance; _rangeTowerButton = RangeTowerButton.Instance; _slowTowerButton = SlowTowerButton.Instance; _healTowerButton = HealTowerButton.Instance; _goldTowerButton = GoldTowerButton.Instance; _upgradeButton = UpgradeButton.Instance; _repairButton = RepairButton.Instance; _sellButton = SellButton.Instance; _yesButton = BCP_Yes.Instance; TowerOperation = Operation.Nop; }
public void SpawnNotification(string title, string description, Sprite graphic) { NotificationPanel newPanel = Instantiate(NotificationPanelPF, NotificationPanelParent); newPanel.SetValues(title, description, graphic); StartCoroutine(HandlePanelShowAndHide(newPanel)); }
protected GameObject NotificationPanel(GameObject parent, string name) { PanelContainerFactory factory = Undoable.AddComponent <PanelContainerFactory>(disposable); factory.parent = parent; factory.containerName = name; factory.panelContainerProfile = panelContainerProfile; GameObject panel = factory.Generate(); NotificationPanel standardPanel = Undoable.AddComponent <NotificationPanel>(panel); standardPanel.grabTarget = panel.transform; standardPanel.panelProfile = panelProfile; #if VRTK CreateThis_VRTK_Interactable interactable = Undoable.AddComponent <CreateThis_VRTK_Interactable>(panel); CreateThis_VRTK_GrabAttach grabAttach = Undoable.AddComponent <CreateThis_VRTK_GrabAttach>(panel); interactable.isGrabbable = true; interactable.grabAttachMechanicScript = grabAttach; #endif Rigidbody rigidbody = Undoable.AddComponent <Rigidbody>(panel); rigidbody.useGravity = false; rigidbody.isKinematic = true; return(panel); }
public void Should_Construct_NotificationPanel() { NotificationPanel notificationPanel = new NotificationPanel(userId, title, content, notificationSettingId, link, branchId, committeeId); _ = new NotificationPanel(); notificationPanel.ShouldNotBeNull(); }
public JsonResult delete_notification(int intID) { NotificationPanel row = db.NotificationPanels.Where(x => x.Sysid == intID).SingleOrDefault(); db.NotificationPanels.Remove(row); db.SaveChanges(); return(Json("", JsonRequestBehavior.AllowGet)); }
public void SpawnUINotification(string message, bool isGoodNotification) { NotificationPanel notificationInstance = (NotificationPanel)Instantiate(m_NotificationPanelPrefab, m_NotificationSpawn.position, Quaternion.identity, this.transform); notificationInstance.SetText(message, isGoodNotification); }
void Start() { _gameBoard = GameManager.Instance.CurrentLevelManager.GameBoardSystem; _buildCheckPanel = BuildCheckPanel.Instance; _towerInfoPanel = TowerInfoPanel.Instance; _notificationPanel = NotificationPanel.Instance; _towerBuildPanel = TowerBuildPanel.Instance; _towerOperationPanel = TowerOperationPanel.Instance; }
void Start() { State = OperationState.Idle; Mode = Operation.Reset; m_originalPos = car.transform.position; m_originalRot = car.transform.rotation; m_car = car.GetComponent <GGObject>(); m_noteboard = notification.GetComponent <NotificationPanel>(); }
void Start() { builder = BuildingManager.Instance.AllBuildings.SingleOrDefault(b => b.ID == activityInformation.builderReferenceID); isFinished = false; notificationPanel = Resources.FindObjectsOfTypeAll <NotificationPanel>()[0]; GetProductionPoint(); InvokeRepeating(nameof(IncreaseCurrentPoint), 0f, 1f); }
void GetSlider() { slider.name = activityInformation.activityName + "Slider"; slider.GetComponent <Slider>().maxValue = ((finishTime - activityInformation.startPoint) / TimeSpan.TicksPerSecond); slider.GetComponent <Slider>().value = timeLeft; slider.GetComponent <Slider>().interactable = false; notificationPanel = Resources.FindObjectsOfTypeAll <NotificationPanel>()[0]; return; }
void Start() { _setAllyTower = false; _clearAllyTower = true; _levelManager = GameManager.Instance.CurrentLevelManager; _gameBoard = _levelManager.GameBoardSystem; _notificationPanel = NotificationPanel.Instance; _enemies = new HashSet <Enemy>(); _tileEventHandlers = new HashSet <TileEventHandler>(); _healtileEventHandlers = new HashSet <TileEventHandler>(); }
//Remove a given Notification Panel from the panel pool. private void removeNotificationPanel(NotificationPanel panel) { panels.Remove(panel); this.flowLayoutPanel1.Controls.Remove(panel); reorderPanels(); if (panels.Count == 0) { showEmptyPanel(true); } }
public void setTowerEventHandler(TileEventHandler teh) { _tileEventHandler = teh; //Debug.Log("SB: setTowerEventHandler called, position" + _tileEventHandler.GridX + " " + _tileEventHandler.GridY); if (null == _buildCheckPanel) { _buildCheckPanel = BuildCheckPanel.Instance; _towerInfoPanel = TowerInfoPanel.Instance; _notificationPanel = NotificationPanel.Instance; } }
public void setTowerEventHandler(TileEventHandler teh) { _enoughGold = true; _destroy = false; if (null == _tileEventHandler) { _buildCheckPanel = BuildCheckPanel.Instance; _towerInfoPanel = TowerInfoPanel.Instance; _notificationPanel = NotificationPanel.Instance; } _tileEventHandler = teh; }
private void CreateNotificationPanel(GameObject parent) { notificationPanelInstance = NotificationPanel(parent, "NotificationPanelInstance"); notificationPanel = notificationPanelInstance.GetComponent <NotificationPanel>(); GameObject column = Column(notificationPanelInstance); GameObject row = Row(column, "LabelRow", TextAlignment.Center); GameObject label = Label(row, "Label", "Notifications Go Here"); notificationLabel = label.GetComponent <TextMesh>(); notificationPanel.notificationLabel = notificationLabel; }
public void SetUserPosition(UserPosition position, int posIndex, Action callback = null) { //Check if we need to destroy the room experience if ((CurrentUserPosition == UserPosition.ThirdPartyRoom || CurrentUserPosition == UserPosition.ThirdPartyTable) && position != CurrentUserPosition && AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience != null && AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience.photonView.isMine) { ThirdPartyExperienceType type = CurrentUserPosition == UserPosition.ThirdPartyRoom ? ThirdPartyExperienceType.Room : ThirdPartyExperienceType.Tabletop; NotificationPanel.NotificationData notificationData = new NotificationPanel.NotificationData(); notificationData.AcceptButtonText = "Ok"; notificationData.CancelButtonText = "Cancel"; notificationData.HeaderText = "Leaving game"; notificationData.MessageText = "If you leave the table, the game will end!"; notificationData.AcceptCallback = delegate { AlcoveThirdPartyExperienceController.getInstance().DestroyThirdPartyExperience(type); SetUserPosition(position, callback); }; NotificationPanel.getInstance().ShowNotification(notificationData, true); return; } if (MinorTeleportationLocation.CurrentPositionCollider) { MinorTeleportationLocation.CurrentPositionCollider.enabled = true; } CurrentUserPosition = position; CurrentUserPositionIndex = posIndex; m_CurrentUserPositionTransform = SetObjectPosition(CameraController.CameraContainer, position, posIndex); //Setup room colliders m_FamilyRoomCollider.enabled = CurrentUserPosition != UserPosition.Family; m_EntertainmentAreaCollider.enabled = CurrentUserPosition != UserPosition.Entertainment; m_TravelAreaCollider.enabled = CurrentUserPosition != UserPosition.Travel; m_HealthAreaCollider.enabled = CurrentUserPosition != UserPosition.Health; m_ThirdPartyTableCollider.enabled = CurrentUserPosition != UserPosition.ThirdPartyTable; m_ThirdPartyRoomCollider.enabled = CurrentUserPosition != UserPosition.ThirdPartyRoom; m_ThirdPartyRoomExitCollider.enabled = CurrentUserPosition == UserPosition.ThirdPartyRoom; HideAllTeleportationGraphics(); callback?.Invoke(); if (m_OnPositionChanged != null) { m_OnPositionChanged(CurrentUserPosition, CurrentUserPositionIndex); } }
IEnumerator HandlePanelShowAndHide(NotificationPanel panel) { activePanels++; yield return(panel.Show(activePanels)); yield return(new WaitForSeconds(2f)); yield return(panel.Hide()); Destroy(panel.gameObject); activePanels--; }
public void PushNotification(string text, Color textColor, Color bgColor) { NotificationPanel notif = Instantiate(notificationPanelPrefab, transform); notif.name = "NotificationPanel"; notif.textComponent.text = text; notif.textComponent.color = textColor; notif.color = bgColor; notif.startTime = Time.time; notif.stopTime = notif.startTime + 2 * fadeDuration + displayDuration; notifications.AddFirst(notif); }
private async Task SendNotificationForUsers(QueryResult <EmployeeIntegrationModel> idmUsers, List <UserNotificationSetting> userNotificationSettings, MainNotificationTemplateModel mainNotificationTemplateModel) { try { string output = JsonConvert.SerializeObject(mainNotificationTemplateModel); MainNotificationTemplateModel mainView = JsonConvert.DeserializeObject <MainNotificationTemplateModel>(output); var userNotificationsModel = userNotificationSettings.Select(x => new UserNotificationSettingModel { UserId = x.UserProfileId.Value, Email = idmUsers.Items.Where(i => i.userId == x.User.Id).FirstOrDefault().email, Mobile = idmUsers.Items.Where(i => i.userId == x.User.Id).FirstOrDefault().mobileNumber }).ToList(); var entityKey = TempletKey(mainView.EntityValue, mainView.EntityType); bool IsNullEmailFirstArrgs = string.IsNullOrEmpty(Convert.ToString(mainView.Args.BodyEmailArgs[0])); bool IsNullSmsmFirstArrgs = string.IsNullOrEmpty(Convert.ToString(mainView.Args.SMSArgs[0])); NotificationEmail email; NotificationSMS sms; NotificationPanel panel; foreach (var setting in userNotificationSettings) { if (IsNullEmailFirstArrgs) { mainView.Args.BodyEmailArgs[0] = Convert.ToString(setting.User.FullName); } if (IsNullSmsmFirstArrgs) { mainView.Args.SMSArgs[0] = Convert.ToString(setting.User.FullName); } NotificationDataModel template = await BuildNotificationTemplate(userNotificationSettings.FirstOrDefault().IsArabic, userNotificationSettings.FirstOrDefault().NotificationCodeId, mainView.Args); if (setting.Email) { email = new NotificationEmail(setting.UserProfileId.Value, userNotificationsModel.FirstOrDefault(u => u.UserId == setting.UserProfileId.Value).Email, template.Email.Title, template.Email.Body, setting.Id, mainView.Link, entityKey); await _notifayCommands.AddNotifayWithOutSave(email); } if (setting.Sms) { sms = new NotificationSMS(setting.UserProfileId.Value, userNotificationsModel.FirstOrDefault(u => u.UserId == setting.UserProfileId.Value).Mobile, template.SMS.Body, setting.Id, mainView.Link, entityKey); await _notifayCommands.AddNotifayWithOutSave(sms); } panel = new NotificationPanel(setting.UserProfileId.Value, template.PanelMessage, template.PanelMessage, setting.Id, mainView.Link, mainView.BranchId, mainView.CommitteeId, entityKey); await _notifayCommands.AddNotifayWithOutSave(panel); } if (userNotificationSettings.Count > 0) { await _notifayCommands.SaveChangesAsync(); } } catch (Exception ex) { _logger.LogError(ex.ToString()); } }
public void setTowerEventHandler(TileEventHandler teh) { _tileEventHandler = teh; if (null == _gameBoard) { _towerController = TowerController.Instance; // used for check range _gameBoard = GameManager.Instance.CurrentLevelManager.GameBoardSystem; // used for highlight _buildCheckPanel = BuildCheckPanel.Instance; // used for set appear _towerInfoPanel = TowerInfoPanel.Instance; // used for set appear _notificationPanel = NotificationPanel.Instance; // used for notification, set appear } }
private void Update() { Vector2 previous = Vector2.zero; LinkedListNode <NotificationPanel> lastAlive = null; bool needRemove = false; int i = 0; float cumulatedHeight = 0f; float previousHeight = 0f; for (LinkedListNode <NotificationPanel> it = notifications.First; it != null; it = it.Next) { NotificationPanel notif = it.Value; cumulatedHeight += notif.rectTransform.rect.height; if (Time.time <= notif.startTime + fadeDuration) { notif.rectTransform.anchoredPosition = Vector2.Lerp(spawnPosition, cumulatedHeight * Vector2.up - spawnPosition, (Time.time - notif.startTime) / fadeDuration); notif.SetAlpha((Time.time - notif.startTime) / fadeDuration); } else { notif.rectTransform.anchoredPosition = (previousHeight + notif.rectTransform.rect.height) * Vector2.up - spawnPosition; if (Time.time < notif.startTime + fadeDuration + displayDuration) { } else if (Time.time <= notif.stopTime) { notif.SetAlpha((notif.stopTime - Time.time) / fadeDuration); } else { Destroy(notif.gameObject); if (!needRemove) { lastAlive = it.Previous; needRemove = true; } } } previousHeight = notif.rectTransform.anchoredPosition.y; ++i; } if (needRemove) { while (notifications.Last != lastAlive) { notifications.RemoveLast(); } } }
//Set a new Notification panel. public void setNotificationPanel(string location, int speed, int speedlim, int distance) { if (panels.Count == 0) { showEmptyPanel(false); } NotificationPanel newpanel = new NotificationPanel(panels.Count, location, distance, speedlim, speed); panels.Insert(0, newpanel); this.flowLayoutPanel1.Controls.Add(newpanel); reorderPanels(); }
// set current selected TileEventHandler public void setTileEventHandler(TileEventHandler teh) { _upgradeCase = false; _tileEventHandler = teh; if (null == _gameBoard) { _levelManager = GameManager.Instance.CurrentLevelManager; _gameBoard = _levelManager.GameBoardSystem; _towerBuildPanel = TowerBuildPanel.Instance; _buildCheckPanel = BuildCheckPanel.Instance; _towerInfoPanel = TowerInfoPanel.Instance; _towerOperationPanel = TowerOperationPanel.Instance; _notificationPanel = NotificationPanel.Instance; } }
public async Task SendNotificationByUserId(int notificationCodeId, int userId, string userName, MainNotificationTemplateModel mainNotificationTemplateModel) { string output = JsonConvert.SerializeObject(mainNotificationTemplateModel); MainNotificationTemplateModel mainView = JsonConvert.DeserializeObject <MainNotificationTemplateModel>(output); var userNotificationSetting = await _iNotificationQuerie.GetNotificationSettingByUserId(notificationCodeId, userId); var entityKey = TempletKey(mainView.EntityValue, mainView.EntityType); if (userNotificationSetting == null) { return; } var userDataFromIDM = await _idmProxy.GetUserbyUserName(userName); var userNotificationsModel = new UserNotificationSettingModel { UserId = userNotificationSetting.UserProfileId.Value, Email = userDataFromIDM != null ? userDataFromIDM.Email : userNotificationSetting.User.Email, Mobile = userDataFromIDM != null ? userDataFromIDM.PhoneNumber : userNotificationSetting.User.Mobile, }; bool IsNullEmailFirstArrgs = string.IsNullOrEmpty(Convert.ToString(mainView.Args.BodyEmailArgs[0])); bool IsNullSmsmFirstArrgs = string.IsNullOrEmpty(Convert.ToString(mainView.Args.SMSArgs[0])); if (IsNullEmailFirstArrgs) { mainView.Args.BodyEmailArgs[0] = Convert.ToString(userNotificationSetting.User.FullName); } if (IsNullSmsmFirstArrgs) { mainView.Args.SMSArgs[0] = Convert.ToString(userNotificationSetting.User.FullName); } NotificationDataModel template = await BuildNotificationTemplate(userNotificationSetting.IsArabic, userNotificationSetting.NotificationCodeId, mainView.Args); if (userNotificationSetting.Email) { var email = new NotificationEmail(userId, userNotificationsModel.Email, template.Email.Title, template.Email.Body, userNotificationSetting.Id, mainView.Link, entityKey); await _notifayCommands.AddNotifayWithOutSave(email); } if (userNotificationSetting.Sms) { var sms = new NotificationSMS(userNotificationSetting.UserProfileId.Value, userNotificationsModel.Mobile, template.SMS.Body, userNotificationSetting.Id, mainView.Link, entityKey); await _notifayCommands.AddNotifayWithOutSave(sms); } var panel = new NotificationPanel(userNotificationSetting.UserProfileId.Value, template.PanelMessage, template.PanelMessage, userNotificationSetting.Id, mainView.Link, mainView.BranchId, mainView.CommitteeId, entityKey); await _notifayCommands.AddNotifayWithOutSave(panel); await _notifayCommands.SaveChangesAsync(); }
public void OperationDenied() { if (null == _gameBoard) { _gameBoard = GameManager.Instance.CurrentLevelManager.GameBoardSystem; _towerBuildPanel = TowerBuildPanel.Instance; _buildCheckPanel = BuildCheckPanel.Instance; _towerInfoPanel = TowerInfoPanel.Instance; _towerOperationPanel = TowerOperationPanel.Instance; _notificationPanel = NotificationPanel.Instance; } _towerBuildPanel.DisAppear(); _buildCheckPanel.DisAppear(); _towerInfoPanel.DisAppear(); _towerOperationPanel.DisAppear(); _notificationPanel.DisAppear(); _gameBoard.ClearHighlightTiles(); }
private static void FormNotificationPanel_Start_Thread() { while (RabbitMQWrapper.myState <= RabbitMQWrapper.State.registering) { Thread.Sleep(500); } if (RabbitMQWrapper.myState == RabbitMQWrapper.State.register_fail) { Globals.log.Debug("AmivoiceWatcher:> Cannot Regisger rabbitMq."); Globals.log.Debug("AmivoiceWatcher:> Not run:> LongNotification.StartNotificationPanel()"); } else { Globals.log.Debug("AmivoiceWatcher:> LongNotification.StartNotificationPanel()"); NotificationPanel.StartNotificationPanel(); } }
private void Log_DisplayMessageRequested(LogMessage logmessage) { ShadowRunHelper.Helper.PlatformHelper.Platform.ExecuteOnUIThreadAsync(async() => { if (logmessage.LogType == LogType.Error) { _ = DisplayAlert(logmessage.LogType.ToString(), logmessage.Message, "OK"); } else { NotificationPanel.IsVisible = true; NotificationPanel.Opacity = 225; NotificationHeaderText.Text = logmessage.LogType.ToString(); NotificationText.Text = logmessage.Message; //casuss thread error await Task.Delay(1000); _ = await NotificationPanel.FadeTo(0, 2000, Easing.Linear); NotificationPanel.IsVisible = false; } }); }
void Awake() { Instance = this; }