public async Task <ResponseModel <UserModel> > CheckUser(string socialId) { var result = await UniversalMethod <object, ResponseModel <UserModel> >(null, ProjectConsts.CheckUserMethodName, AppResources.GetResource("Error"), new object[] { socialId }); return(result); }
private void LoadUserResources(User user) { switch (user.GetUserType()) { case UserType.DOCTOR: { AppResources.getInstance().LoadDoctorResources(); break; } case UserType.MANAGER: { AppResources.getInstance().LoadManagerResources(); break; } case UserType.PATIENT: { AppResources.getInstance().LoadPatientResources(); break; } case UserType.SECRETARY: { AppResources.getInstance().LoadSecretaryResources(); break; } } }
/// <summary> /// Handle events fired when a result is generated. This may include a garbage rule that fires when general room noise /// or side-talk is captured (this will have a confidence of Rejected typically, but may occasionally match a rule with /// low confidence). /// </summary> /// <param name="sender">The Recognition session that generated this result</param> /// <param name="args">Details about the recognized speech</param> private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args) { // The garbage rule will not have a tag associated with it, the other rules will return a string matching the tag provided // when generating the grammar. string tag = AppResources.GetString("unknown"); if (args.Result.Constraint != null) { tag = args.Result.Constraint.Tag; } // Developers may decide to use per-phrase confidence levels in order to tune the behavior of their // grammar based on testing. if (args.Result.Confidence == SpeechRecognitionConfidence.Medium || args.Result.Confidence == SpeechRecognitionConfidence.High) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { edHearState.Text = $"{AppResources.GetString("Heard")}: {args.Result.Text}, ({AppResources.GetString("Tag")}: {tag}, {AppResources.GetString("Confidence")}: {args.Result.Confidence.ToString()})"; edContent.Text += string.Format("{0}", args.Result.Text); edContent.SelectionStart = edContent.Text.Length; }); } else { // In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech // is not the primary input mechanism for the application. await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { edHearState.Text = $"{AppResources.GetString("VoiceCatchFailed")}. ({AppResources.GetString("Heard")}: {args.Result.Text}, {AppResources.GetString("Tag")}: {tag}, {AppResources.GetString("Confidence")}: {args.Result.Confidence.ToString()})"; }); } }
async public Task <int> Reset() { var dialog = new ContentDialog() { Title = AppResources.GetString("Warnning"), Content = AppResources.GetString("AreYouSure"), PrimaryButtonText = AppResources.GetString("Confirm"), SecondaryButtonText = AppResources.GetString("Cancel"), FullSizeDesired = false, }; dialog.PrimaryButtonClick += (_s, _e) => { }; var res = await dialog.ShowAsync(); if (res.ToString() != "Primary") { return(0); } ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); app_data.ISMUTE = false; app_data.ISNIGHT = false; app_data.ISFULLSCREEN = true; app_data.HAVEDONE = 0; app_data.MUSICVOLUME = app_data.SFXVOLUME = 1; app_data.ACHIEVEMENTS = new ObservableCollection <Achievements>(); app_data.ACHIEVEMENT = "000000"; update_views(); setAchievement(); update_grid(); return(0); }
public static uint GetConferenceId() { if (_conferenceId != 0) { return(_conferenceId); } var conference = GetConference(ProjectConsts.DefaultConferenceName); //current approach used for hardcoded one Conference without selection if (conference == null) { throw new XmlException(AppResources.GetResource("ConfigNoConferenciesError")); } var value = conference.Attribute("ID"); if (value == null) { throw new XmlException(AppResources.GetResource("ConfigConferenceIDError")); } var result = uint.Parse(value.Value); if (result <= 0) { throw new ArgumentException(AppResources.GetResource("ConfigCompIDUnexpectedError")); } _conferenceId = result; return(_conferenceId); }
public static string GetMainServiceUrl() { if (!string.IsNullOrEmpty(_mainServiceUrl)) { return(_mainServiceUrl); } var mainService = GetService(ProjectConsts.MainServiceName); if (mainService == null) { throw new XmlException(AppResources.GetResource("ConfigMainServiceMissingError")); } var url = mainService.Attribute("Url"); if (url == null) { throw new XmlException(AppResources.GetResource("ConfigMainServiceUrlSectionMissingError")); } var urlValue = url.Value; if (string.IsNullOrEmpty(urlValue)) { throw new ArgumentException(AppResources.GetResource("ConfigMainServiceUrlBrockenError")); } _mainServiceUrl = urlValue; return(_mainServiceUrl); }
public IActionResult Get(string pharmacyName) { PharmacyApiKey key = new PharmacyApiKey(pharmacyName + "_1234", pharmacyName); AppResources.getInstance().pharmacyApiKeyService.Create(key); return(Ok()); }
private void Populate(string searchTerm = "") { GalleryWrapper.Children.Clear(); foreach (var block in LevelDataBlock.LoadAllFromDB()) { if (searchTerm == "" || block.Name.ToLower().Contains(searchTerm.ToLower())) { var stack = new StackPanel(); stack.Children.Add(new Image() { }); stack.Children.Add(new TextBlock() { Text = block.Name, TextWrapping = TextWrapping.Wrap, //Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF343434")) }); var button = new Button() { Content = stack, Tag = block, Padding = new Thickness(10), Margin = new Thickness(5, 5, 0, 0), Background = new SolidColorBrush(AppResources.S_ColorConvert(block.Color)) }; button.Click += delegate { OnDataSelected?.Invoke(this, button.Tag as LevelDataBlock); }; GalleryWrapper.Children.Add(button); } } }
public async Task <IActionResult> History(string id) { string ser = id; //string ser = "J0251"; ViewData["Serial"] = ser; string prefix = Startup.AppSettings["AzureUrlPrefix"]; string container = Startup.AppSettings["CalCertContainer"]; var history = _context.CalDateRepository.GetRecords(r => r.Serial == ser); foreach (var entry in history) { entry.KindOfCal = ""; if (entry.IsCal == true) { entry.KindOfCal = "Cal"; } else if (entry.IsCal == false) { entry.KindOfCal = "Safety"; } string filename = entry.PdfFileName; if (!string.IsNullOrWhiteSpace(filename)) { string folder = AppResources.GetCalCertFolder(filename); entry.urlToFile = $"{prefix}{container}/{folder}/{filename}"; } else { entry.PdfFileName = ""; } } //await _hubContext.Clients.Client(ConId).SendAsync("HistoryFinished"); return(View(history)); }
public LevelSucceedDialog() { this.InitializeComponent(); Title = AppResources.GetString("Congratulations"); passT.Text = AppResources.GetString("Problemsolved"); PrimaryButtonText = AppResources.GetString("PLAYAGAIN"); SecondaryButtonText = AppResources.GetString("NEXTLEVEL"); }
public static string FromEnum(Enum value) { #if ANDROID return(AppResources.FromEnum(value.GetType().Name + "_" + value.ToString())); #else return(AppResources.ResourceManager.GetString(value.GetType().Name + "_" + value)); #endif }
public static string FromEnum(string EnumName, string Value) { #if ANDROID return(AppResources.FromEnum(EnumName + "_" + Value)); #else return(AppResources.ResourceManager.GetString(EnumName + "_" + Value)); #endif }
public void Login(string username, string password) { User user = _userRepository.GetByUsername(username); CheckUserCredentials(user, password); AppResources.getInstance().loggedInUser = user; LoadUserResources(user); }
private void Awake() { gResources = Resources; Screen.width = (int)(UE.Screen.width / Application.ScaleX); Screen.height = (int)(UE.Screen.height / Application.ScaleY); Graphics.ApiGraphics = ApiHolder.Graphics; // Enum + dictionary? GdiImages = new AppGdiImages(); GdiImages.ArrowDown = gResources.Images.ArrowDown.ToBitmap(); GdiImages.ArrowLeft = gResources.Images.ArrowLeft.ToBitmap(); GdiImages.ArrowRight = gResources.Images.ArrowRight.ToBitmap(); GdiImages.ArrowUp = gResources.Images.ArrowUp.ToBitmap(); GdiImages.Circle = gResources.Images.Circle.ToBitmap(); GdiImages.Checked = gResources.Images.Checked.ToBitmap(); GdiImages.Close = gResources.Images.Close.ToBitmap(); GdiImages.CurvedArrowDown = gResources.Images.CurvedArrowDown.ToBitmap(); GdiImages.CurvedArrowLeft = gResources.Images.CurvedArrowLeft.ToBitmap(); GdiImages.CurvedArrowRight = gResources.Images.CurvedArrowRight.ToBitmap(); GdiImages.CurvedArrowUp = gResources.Images.CurvedArrowUp.ToBitmap(); GdiImages.DateTimePicker = gResources.Images.DateTimePicker.ToBitmap(); GdiImages.DropDownRightArrow = gResources.Images.DropDownRightArrow.ToBitmap(); GdiImages.FormResize = gResources.Images.FormResize.ToBitmap(); GdiImages.NumericDown = gResources.Images.NumericDown.ToBitmap(); GdiImages.NumericUp = gResources.Images.NumericUp.ToBitmap(); GdiImages.RadioButton_Checked = gResources.Images.RadioButton_Checked.ToBitmap(); GdiImages.RadioButton_Hovered = gResources.Images.RadioButton_Hovered.ToBitmap(); GdiImages.RadioButton_Unchecked = gResources.Images.RadioButton_Unchecked.ToBitmap(); GdiImages.TreeNodeCollapsed = gResources.Images.TreeNodeCollapsed.ToBitmap(); GdiImages.TreeNodeExpanded = gResources.Images.TreeNodeExpanded.ToBitmap(); GdiImages.Cursors.Default = gResources.Images.Cursors.Default.ToBitmap(); GdiImages.Cursors.HSplit = gResources.Images.Cursors.HSplit.ToBitmap(); GdiImages.Cursors.Hand = gResources.Images.Cursors.Hand.ToBitmap(); GdiImages.Cursors.Help = gResources.Images.Cursors.Help.ToBitmap(); GdiImages.Cursors.SizeAll = gResources.Images.Cursors.SizeAll.ToBitmap(); GdiImages.Cursors.SizeNESW = gResources.Images.Cursors.SizeNESW.ToBitmap(); GdiImages.Cursors.SizeNS = gResources.Images.Cursors.SizeNS.ToBitmap(); GdiImages.Cursors.SizeNWSE = gResources.Images.Cursors.SizeNWSE.ToBitmap(); GdiImages.Cursors.SizeWE = gResources.Images.Cursors.SizeWE.ToBitmap(); GdiImages.Cursors.VSplit = gResources.Images.Cursors.VSplit.ToBitmap(); lastWidth = UE.Screen.width; lastHeight = UE.Screen.height; controller = new Application(); controller.Resources = GdiImages; controller.UpdatePaintClipRect(); Control.uwfDefaultController = controller; #if UNITY_EDITOR MouseHook.MouseUp += (sender, args) => Inspect(sender); #endif }
public IActionResult Add(NewFeedbackDTO dto) { if (!FeedbackValidation.isNewFeedbackValid(dto)) { return(BadRequest()); } return(Ok(AppResources.getInstance().feedbackService.Create(FeedbackMapper.NewFeedbackDTOToFeedback(dto)))); }
public void UpdateLanguageResources() { var strings = (LocalizedStrings)System.Windows.Application.Current.Resources["LocalizedStrings"]; _resources = null; _resources = new AppResources(); strings.OnPropertyChanged("Item[]"); // For accessor strings.OnPropertyChanged("LocalizedResources"); }
public void Initialize() { var fixationActivator = new FixationActivator(ref _tobiiHost) { DurationToActivate = AppResources.GetFixation2ActivateTime() }; fixationActivator.OnActivate += OnFixationActivation; }
[HttpGet("published")] //GET /api/feedback/published public IActionResult GetPublishedFeedbacks() { List <Feedback> feedbacks = AppResources.getInstance().feedbackService.GetAllPublished(); if (feedbacks == null) { return(NotFound()); } return(Ok(feedbacks.Select(feedback => FeedbackMapper.FeedbackToFeedbackDto(feedback)).ToArray())); }
private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (isPopulatingLanguages) { return; } Language targetLang = (Language)(cbLanguageSelection.SelectedItem as ComboBoxItem).Tag; await InitializeRecognizer(targetLang); edHearState.Text = AppResources.GetString("Idle"); }
public async Task <ResponseModel <UserModel> > SetUser([NotNull] UserModel user, int id) { var result = await UniversalMethod <UserModel, ResponseModel <UserModel> >(user, ProjectConsts.SetUserMethodName, AppResources.GetResource("Error"), new object[] { id }); OnUserChanged(new UserUpdatedEventArgs { User = result.FirstResponce }); return(result); }
void Redisplay() { //reset SelectorMode = KeySelectorMode.Start; selectedStartFrame = selectedEndFrame = 0; cursorShown = false; endCursor = startCursor = cursor = null; space = null; KeySelector.Children.Clear(); //display sequences foreach (var seq in _sequences) { if (seq.IsRootSeq) { continue; } SolidColorBrush randomColor = new SolidColorBrush(AppResources.BatchRandomColor(1)[0]); Brush semiTransparent = new SolidColorBrush(randomColor.Color); semiTransparent.Opacity = .5; Border border = null; KeySelector.Children.Add( border = new Border { Child = new TextBlock() { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Text = (string.IsNullOrWhiteSpace(seq.Name) ? seq.ID.ToString() : seq.Name + $" ({seq.ID})") + $": {seq.FrameLength} frames", Padding = new Thickness(5, 3, 5, 3), TextWrapping = TextWrapping.Wrap, Background = randomColor, TextAlignment = TextAlignment.Center }, Padding = new Thickness(10), BorderBrush = randomColor, BorderThickness = new Thickness(2, 0, 2, 0), Background = semiTransparent, Width = (seq.FrameLength / (double)blitz3DAnimation.Frames) * KeySelector.ActualWidth, Height = KeySelector.ActualHeight }); if (border.Width < 60) { ((TextBlock)border.Child).Text = seq.ID.ToString(); border.Padding = new Thickness(0); } Canvas.SetLeft(border, (seq.First / (double)blitz3DAnimation.Frames) * KeySelector.ActualWidth); } DescBlock.Text = $"Sequences: {_sequences.Count()}, Frames: {preview.numPositionKeys()}"; DataChart.DisplayAnimation(preview); }
private static XElement GetConfigEntity(string sectionType, string name) { if (Settings.Root == null) { throw new XmlException(AppResources.GetResource("ConfigRootElError")); } var el = Settings.Root; //if (el == null) throw new XmlException(AppResources.ConfigMainElError); return(el.DescendantsAndSelf().Where(x => x.Name == sectionType) .FirstOrDefault(element => (element.Attribute("Name") ?? new XAttribute("Name", string.Empty)).Value == name)); }
/// <summary> /// 从运行目录上一级的Resource文件夹下取Images /// </summary> /// <returns></returns> public IEnumerable <ImageSource> RollImages() { yield return(AppResources.GetImageSource(@"Images\rollimg\img1.png")); yield return(AppResources.GetImageSource(@"Images\rollimg\img2.png")); yield return(AppResources.GetImageSource(@"Images\rollimg\img3.png")); yield return(AppResources.GetImageSource(@"Images\rollimg\img4.png")); yield return(AppResources.GetImageSource(@"Images\rollimg\img5.png")); yield return(AppResources.GetImageSource(@"Images\rollimg\img6.png")); }
protected override void OnPrepareBindings(View view) { var button = view.FindViewById <Button>(Resource.Id.login_button); var email = view.FindViewById <EditText>(Resource.Id.login_email); var pwd = view.FindViewById <EditText>(Resource.Id.login_password); button.SetBackgroundDrawable(AppResources.GetDrawable(Resource.Drawable.login_btn_selector)); button.Click += (s, a) => { ViewModel.Email = email.Text; ViewModel.Password = pwd.Text; ViewModel.LoginCommand.Execute(null); }; }
public override void Dispose() { Controller?.RemoveMessage(this, KEY_LEGITIMACY); Controller?.RemoveMessage(this, KEY_MULTITHREAD); Controller?.SetSubmitButtonEnabled(this, false); Controller?.SetThreadLayoutVisibility(this, false); Controller?.SetRecommendedName(this, AppResources.GetString("Unknown"), 0.5); Controller?.RemoveAnalyser(this); _hresp_?.Dispose(); _hresp_ = null; URL = null; GC.Collect(); }
/// <summary> /// Handle events fired when error conditions occur, such as the microphone becoming unavailable, or if /// some transient issues occur. /// </summary> /// <param name="sender">The continuous recognition session</param> /// <param name="args">The state of the recognizer</param> private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args) { if (args.Status != SpeechRecognitionResultStatus.Success) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { edHearState.Text = $"{AppResources.GetString("RecognitionCompleted")} {AppResources.GetString(args.Status.ToString())}"; BtnCancel.Visibility = Visibility.Collapsed; btnListen.Content = AppResources.GetString("Listen"); btnListen.IsChecked = false; cbLanguageSelection.IsEnabled = true; isListening = false; }); } }
/// <summary> /// Get seed data from fire resource /// </summary> private IrpfTax[] GetSeedData() { string content; using (var stream = new StreamReader(AppResources.GetSeedData("irpf.json"))) { content = stream.ReadToEnd(); } IrpfTax[] docs = JsonSerializer.Deserialize <IrpfTax[]>(content, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true }); return(docs); }
/// <summary> /// Provide feedback to the user based on whether the recognizer is receiving their voice input. /// </summary> /// <param name="sender">The recognizer that is currently running.</param> /// <param name="args">The current state of the recognizer.</param> private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var state = args.State.ToString().Trim(); edHearState.Text = AppResources.GetString(state); //rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage); if (state.Equals("Idle", StringComparison.CurrentCultureIgnoreCase)) { btnListen.Content = AppResources.GetString("Listen"); btnListen.IsChecked = false; cbLanguageSelection.IsEnabled = true; isListening = false; } }); }
private void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e) { System.Diagnostics.Debug.WriteLine("LeavingBackground"); _isInBackgroundMode = false; MemoryManager.AppMemoryUsageIncreased -= OnMemoryIncreased; MemoryManager.AppMemoryUsageLimitChanging -= OnMemoryLimitChanged; if (_isMusicBoardBeShutDown) // REBUILD MUSIC BOARD { _isMusicBoardBeShutDown = false; AppResources.NavigateToBase?.Invoke( null, AppResources.MusicIsCurrent, AppResources.GetFrameInstance(FrameType.UpContent), AppResources.GetPageType(NavigateType.MusicBoard)); } }
public async void success() { BGMPlayer.PlayButton8(); LevelSucceedDialog lsd = new LevelSucceedDialog(); APPDATA.app_data.HAVEDONE = Math.Max(APPDATA.app_data.HAVEDONE, localLevel.ID); var ach = APPDATA.app_data.ACHIEVEMENT; APPDATA.app_data.setAchievement(); for (int i = 0; i < 6; i++) { if (ach[i] == '0' && APPDATA.app_data.ACHIEVEMENT[i] == '1') { CONST.ShowToastNotification("Square150x150Logo.scale-200.png", AppResources.GetString("isunlock"), NotificationAudioNames.Default); } } var res = await lsd.ShowAsync(); if (res.ToString() == "Primary") { //APPDATA.app_data.MoveTo(AppPage.GamePage,localLevel); } else { if (localLevel.ID % 9 == 0) { APPDATA.app_data.MoveTo(AppPage.SelectChapterPage); var c = SelectGame.localChapter; if (c.ID >= APPDATA.app_data.Chapters.Count) { return; } APPDATA.app_data.Chapters[c.ID].unlocked = 1; return; } var levels = Level.getLevels(SelectGame.localChapter.ID); foreach (var l in levels) { if (l.ID == localLevel.ID + 1) { APPDATA.app_data.MoveTo(AppPage.GamePage, l); } } } }
public LocalizedStrings() { _localizedResources = new AppResources(); }