Пример #1
0
        private static int GenreColumnComparison(MusicFileDataModel x, MusicFileDataModel y)
        {
            var genreX = x.MusicFile.IsMetadataLoaded ? StringListConverter.ToString(x.MusicFile.Metadata.Genre) : "";
            var genreY = y.MusicFile.IsMetadataLoaded ?  StringListConverter.ToString(y.MusicFile.Metadata.Genre) : "";

            return(string.Compare(genreX, genreY, StringComparison.CurrentCulture));
        }
        public void ToStringTest()
        {
            var nl = Environment.NewLine;
            var ls = CultureInfo.CurrentCulture.TextInfo.ListSeparator;

            Assert.AreEqual("", StringListConverter.ToString(null));
            Assert.AreEqual("", StringListConverter.ToString(new string[0]));
            Assert.AreEqual("", StringListConverter.ToString(new[] { "" }));

            Assert.AreEqual("Pop", StringListConverter.ToString(new[] { "Pop" }));
            Assert.AreEqual("Pop" + ls + " Rock", StringListConverter.ToString(new[] { "Pop", "Rock" }));
            Assert.AreEqual("Pop" + nl + "Rock", StringListConverter.ToString(new[] { "Pop", "Rock" }, nl));
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            IEnumerable <string> list = (IEnumerable <string>)value;

            return(StringListConverter.ToString(list, GetSeparator(parameter)));
        }
Пример #4
0
 private static void ApplyAsOneItem(IList <string> target, IEnumerable <string> source)
 {
     // The WinRT API does not support some of the multiple tags for MP3 files; it aborts saving the metadata without error :-(
     target.Clear();
     target.Add(StringListConverter.ToString(source));
 }
Пример #5
0
 private static void ApplyAsOneItem(IList <string> target, IEnumerable <string> source)
 {
     // The WinRT API does not support some of the multiple tags for MP4 files
     target.Clear();
     target.Add(StringListConverter.ToString(source));
 }
 public object Convert(object _value, Type _targetType, object _parameter, CultureInfo _culture)
 => StringListConverter.ToString(((IEnumerable <string>)_value), GetSeparator(_parameter));