Example #1
0
        public static bool FixOrValidateInputRel(
            string rel,
            bool isRssEncl,
            out SFRel Rel,
            out string relOther)
        {
            relOther = null;

            if (isRssEncl)
            {
                Rel = SFRel.enclosure;
            }
            else
            {
                Rel = SFRel.none;

                rel = rel.NullIfEmptyTrimmed();

                if (rel != null)
                {
                    if (SFRelTypesX.RelsDictionary.TryGetValue(rel, out SFRel _rl))
                    {
                        Rel = _rl;
                    }
                    else
                    {
                        relOther = rel;
                    }
                }
            }

            return(true);
        }
Example #2
0
        public void Link1(
            string inUrl,
            string finUrl,
            string inMimeTypeStr,
            BasicMimeType inMimeType,
            BasicMimeType finMimeType,
            string inRel,
            bool inIsRssEncl,
            SFRel finRel)
        {
            var lk = new SFLink(inUrl, inMimeTypeStr, inRel, isRssEncl: inIsRssEncl, mimeType: inMimeType);

            True(lk.MimeType == finMimeType);
            True(lk.Rel == finRel);
            True(lk.Url == (finUrl.NullIfEmpty() ?? inUrl));
        }
Example #3
0
 public static string ToStringFast(this SFRel rel)
 {
     return(SFRelTypesX.RelsDictionaryReverse[rel]);
 }
Example #4
0
 public static bool IsNotEnclosureOrSelf(this SFRel rel)
 {
     return(rel != SFRel.enclosure && rel != SFRel.self);
 }