private void UpdateVisibleIcons() { var addAll = string.IsNullOrWhiteSpace(FilterText); //Confirm regex is valid if (!addAll) { try { _ = Regex.IsMatch(string.Empty, FilterText); } catch (Exception) { addAll = true; } } //Add all if no proper filter is applied VisibleIcons = addAll ? AllIcons : new List <EFontAwesomeIcon>(AllIcons.Where(icon => Regex.IsMatch( icon.GetInformation().Label , FilterText , RegexOptions.IgnoreCase ))); SelectedIcon = VisibleIcons.FirstOrDefault(); }
private void SetIcons() { companyIcon = AllIcons.RandomCompanyIcon(color, colors[color]); companyBackground = AllIcons.CompanyBackground(color); companyFlag = AllIcons.CompanyFlag(color); flag.GetComponent <Image>().sprite = companyFlag; background.GetComponent <Image>().sprite = companyBackground; icon.GetComponent <Image>().sprite = companyIcon; }
public MainWindowViewModel() { AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast <EFontAwesomeIcon>().ToList(); AllIcons.Remove(EFontAwesomeIcon.None); SelectedIcon = AllIcons.First(); FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast <EFlipOrientation>().ToList(); SpinDuration = 5; FontSize = 30; Rotation = 0; }
public MainViewModel() { AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast <EFontAwesomeIcon>() .OrderBy(i => i.GetStyle()).ThenBy(i => i.GetLabel()).ToList(); AllIcons.Remove(EFontAwesomeIcon.None); SelectedIcon = AllIcons.First(); FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast <EFlipOrientation>().ToList(); SpinDuration = 5; FontSize = 30; Rotation = 0; }
public MainWindowViewModel() { AllIcons = Enum.GetValues(typeof(EFontAwesomeIcon)).Cast <EFontAwesomeIcon>() .OrderBy(i => i.GetStyle()).ThenBy(i => i.GetLabel()).ToList(); AllIcons.Remove(EFontAwesomeIcon.None); UpdateVisibleIcons(); FlipOrientations = Enum.GetValues(typeof(EFlipOrientation)).Cast <EFlipOrientation>().ToList(); SpinDuration = 5; PulseDuration = 5; FontSize = 30; Rotation = 0; Visibilities = Enum.GetValues(typeof(Visibility)).Cast <Visibility>().ToList(); Visibility = Visibility.Visible; }
/// <summary> /// Gets a <see cref="FileIcon" /> from the resources of BytecodeApi.FileIcons.dll, if the specified extension is known; otherwise, returns <see langword="null" />. /// </summary> /// <param name="extension">A <see cref="string" /> value specifying the file extension, which is case insensitive and does not require a leading dot character.</param> /// <returns> /// A <see cref="FileIcon" /> object containing image objects for the specified extension, if found; /// otherwise, returns <see langword="null" />. /// </returns> public static FileIcon FromExtension(string extension) { Check.ArgumentNull(extension, nameof(extension)); return(AllIcons.FirstOrDefault(icon => icon.Extension.Equals(extension.TrimStart('.'), SpecialStringComparisons.IgnoreCase))); }