All pastes #28491 Raw Edit

Unnamed

public text v1 · immutable
#28491 ·published 2005-11-12 21:53 UTC
rendered paste body
public void Delete(Stream raf, Stream tempRaf) {
			OggTag tag = null;
			try {
				tag = (OggTag) reader.Read(raf);
			} catch(CannotReadException e) {
				Write(new OggTag(), raf, tempRaf);
				return;
			}
			
			OggTag emptyTag = new OggTag();
			if (tag.HasField("vendor"))
				emptyTag.Set("vendor", tag.Get("vendor")[0]);
			
			Write(emptyTag, raf, tempRaf);
		}
---------------------------------------------------
public void Set(string id, string content) 
		{
			if (id == null || content == null)
				return;

			id = id.ToLower();
			
			// If there is already an existing field with same id
			// we update the first element
			IList list = fields[id] as IList;
			if(list != null && list.Count > 0) {
				list [0] = content;
				return;
			}
			
			// Else we put the new field in the fields.
			list = new ArrayList();
			list.Add(content);
			fields[id] = list;
		}

		public void Set(CommonField id, string content)
		{
			Set(id.ToString(), content);
		}
-------------------------------------------
./Ogg/Util/VorbisTagWriter.cs(49) error CS1502: The best overloaded match for method 'Entagged.Audioformats.Tag.Set( Entagged.Audioformats.CommonField,  string)' has some invalid arguments
./Ogg/Util/VorbisTagWriter.cs(49) error CS1503: Argument 1: Cannot convert from 'string' to ' Entagged.Audioformats.CommonField'
./Ogg/Util/VorbisTagWriter.cs(49) error CS1501: No overload for method `Set' takes `2' arguments
Compilation failed: 3 error(s), 0 warnings