SetTag() public method

public SetTag ( string name, string value ) : void
name string
value string
return void
Exemplo n.º 1
0
 public void YearSetTest()
 {
     Mp3Tags tags = new Mp3Tags();
     tags.SetTag("year", "2015");
     Assert.AreEqual(2015u, tags.Year);
     tags.SetTag("year", "two thousand fifteen");
 }
Exemplo n.º 2
0
 public void SetTest()
 {
     Mp3Tags tags=new Mp3Tags();
     ArgumentException expectedException=null;
     try
     {
         tags.SetTag(null, "sd");
     }
     catch (ArgumentException e)
     {
         expectedException = e;
     }
     Assert.IsNotNull(expectedException);
     tags.SetTag("artist","test");
     Assert.AreEqual("test",tags.Artist);
     tags.SetTag("album", "test");
     Assert.AreEqual("test", tags.Album);
     tags.SetTag("coMment", "test");
     Assert.AreEqual("test", tags.Comment);
     tags.SetTag("genre", "test");
     Assert.AreEqual("test", tags.Genre);
     tags.SetTag("title", "test");
     Assert.AreEqual("test", tags.Title);
     tags.SetTag("not existing tag","value");
 }
Exemplo n.º 3
0
        internal Mp3Tags GetTagsFromName(Mask mask)
        {
            var tags         = new Mp3Tags();
            var tagsFromName = mask.GetTagValuesFromString(CurrentFile.Name);

            foreach (var tag in tagsFromName.First())
            {
                tags.SetTag(tag.Key, tag.Value);
            }
            return(tags);
        }
Exemplo n.º 4
0
        Mp3Tags GetTagsFromFileName(IMp3File file)
        {
            if (file == null)
                throw new ArgumentException("File is not loaded");
            Menu.PrintHelp();

            var fileName = file.Name;
            var mask = new Mask(Menu.GetUserInput("mask:"));
            var tagValues = Select(mask.GetTagValuesFromString(fileName));
            var result = new Mp3Tags();

            foreach (var tagValue in tagValues)
            {
                result.SetTag(tagValue.Key, tagValue.Value);
            }
            return result;
        }
Exemplo n.º 5
0
 internal Mp3Tags GetTagsFromName(Mask mask)
 {
     var tags = new Mp3Tags();
     var tagsFromName = mask.GetTagValuesFromString(CurrentFile.Name);
     foreach (var tag in tagsFromName.First())
     {
         tags.SetTag(tag.Key, tag.Value);
     }
     return tags;
 }