Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

override TagLib.Tag TagLib::Image::File::GetTag ( TagLib.TagTypes  type,
bool  create 
) [inline, inherited]

Gets a tag of a specified type from the current instance, optionally creating a new tag if possible.

typeA TagLib.TagTypes value indicating the type of tag to read.
createA bool value specifying whether or not to try and create the tag if one is not found.
A Tag object containing the tag that was found in or added to the current instance. If no matching tag was found and none was created, is returned.

Reimplemented in TagLib::Tiff::Rw2::File.

Definition at line 164 of file File.cs.

References TagLib::Tag::TagTypes.

                  foreach (Tag tag in ImageTag.AllTags) {
                        if ((tag.TagTypes & type) == type)
                              return tag;

                  if (!create || (type & ImageTag.AllowedTypes) == 0)
                        return null;

                  ImageTag new_tag = null;
                  switch (type) {
                  case TagTypes.JpegComment:
                        new_tag = new JpegCommentTag ();

                  case TagTypes.GifComment:
                        new_tag = new GifCommentTag ();

                  case TagTypes.Png:
                        new_tag = new PngTag ();

                  case TagTypes.TiffIFD:
                        new_tag = new IFDTag ();

                  case TagTypes.XMP:
                        new_tag = new XmpTag ();

                  if (new_tag != null) {
                        ImageTag.AddTag (new_tag);
                        return new_tag;

                  throw new NotImplementedException (String.Format ("Adding tag of type {0} not supported!", type));

Generated by  Doxygen 1.6.0   Back to index