Exemple #1
0
 public TagLib(TagLibMode mode=TagLibMode.Strict)
 {
     Mode = mode;
     Register(new Core());
     Register(new Format());
     Register(new Xml());
 }
Exemple #2
0
 public TagLib(TagLibMode mode = TagLibMode.Strict)
 {
     Mode = mode;
     Register(new Core());
     Register(new Format());
     Register(new Xml());
 }
Exemple #3
0
 public TagLib(TagLibMode mode,params ITagGroup[] groups)
 {
     Mode = mode;
     foreach (var group in groups)
     {
         Register(group);
     }
 }
Exemple #4
0
 public TagLib(TagLibMode mode, params ITagGroup[] groups)
 {
     Mode = mode;
     foreach (var group in groups)
     {
         Register(group);
     }
 }
Exemple #5
0
        public Formatter SwitchToMode(TagLibMode mode)
        {
            if (_templateParsed != null)
            {
                throw new InvalidOperationException("SwitchToMode can only be called before calling Parse!");
            }

            var lib = new TagLib(mode, _lib.ToArray());

            _lib = lib;
            return(this);
        }
Exemple #6
0
        public static Formatter FileBasedFormatter(string path, TagLibMode mode, ITagLib lib = null)
        {
            var locator = new FileBasedResourceLocator();

            return(new Formatter(locator.GetDataAsString(path)).
                   OverrideLib(lib).
                   AllowTags(true).
                   SetLocatorFactory(new FileLocatorFactory()).
                   SetInitialLocator(locator.Update(path)).
                   SwitchToMode(mode).
                   SetTagValidator(CreateTagValidatorFor(lib)).
                   Parse());
        }
Exemple #7
0
 public static Formatter FileBasedFormatter(string path, TagLibMode mode, ITagLib lib=null)
 {
     var locator = new FileBasedResourceLocator();
     return new Formatter(locator.GetDataAsString(path)).
                 OverrideLib(lib).
                 AllowTags(true).
                 SetLocatorFactory(new FileLocatorFactory()).
                 SetInitialLocator(locator.Update(path)).
                 SwitchToMode(mode).
                 SetTagValidator(CreateTagValidatorFor(lib)).
                 Parse();
 }
Exemple #8
0
        public Formatter SwitchToMode(TagLibMode mode)
        {
            if (_templateParsed != null)
                throw new InvalidOperationException("SwitchToMode can only be called before calling Parse!");

            var lib=new TagLib(mode,_lib.ToArray());
            _lib = lib;
            return this;
        }