Ejemplo n.º 1
0
        public bool Matches(string text, bool nameOnly)
        {
            CultureInfo Culture = CultureInfo.InvariantCulture;

            if (nameOnly)
            {
                return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0);
            }
            return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Source ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Description ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Alignment ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Speeds.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   Senses.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   Resistances.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   Vulnerablities.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   Immunities.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   Languages.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   ConditionImmunities.Exists(s => Culture.CompareInfo.IndexOf(s ?? "", text, CompareOptions.IgnoreCase) >= 0) ||
                   Descriptions.Exists(s => s.Matches(text, nameOnly)) ||
                   Traits.Exists(s => s.Matches(text, nameOnly)) ||
                   LegendaryActions.Exists(s => s.Matches(text, nameOnly)) ||
                   Actions.Exists(s => s.Matches(text, nameOnly)) ||
                   Keywords.Exists(s => Culture.CompareInfo.IndexOf(s.Name ?? "", text, CompareOptions.IgnoreCase) >= 0));
        }
Ejemplo n.º 2
0
 /// <summary> Add a new description to be included within the Identify response of the OAI-PMH protocol </summary>
 /// <param name="NewDescription"> New custom description to be included </param>
 public void Add_Description(string NewDescription)
 {
     if (Descriptions == null)
     {
         Descriptions = new List <string>();
     }
     if (!(Descriptions.Exists(s => s.IndexOf(NewDescription, StringComparison.OrdinalIgnoreCase) >= 0)))
     {
         Descriptions.Add(NewDescription);
     }
 }
Ejemplo n.º 3
0
        public bool Matches(string text, bool nameOnly)
        {
            CultureInfo Culture = CultureInfo.InvariantCulture;

            if (nameOnly)
            {
                return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0);
            }
            return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Source ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Description ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Flavour ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Features.Exists(s => s.Matches(text, nameOnly)) ||
                   Descriptions.Exists(s => s.Matches(text, nameOnly)));
        }
Ejemplo n.º 4
0
        public bool Matches(string text, bool nameOnly)
        {
            CultureInfo Culture = CultureInfo.InvariantCulture;

            if (nameOnly)
            {
                return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0);
            }
            return(Culture.CompareInfo.IndexOf(Name ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Source ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Description ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(CastingTime ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Range ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Culture.CompareInfo.IndexOf(Duration ?? "", text, CompareOptions.IgnoreCase) >= 0 ||
                   Descriptions.Exists(s => s.Matches(text, nameOnly)) ||
                   Keywords.Exists(s => Culture.CompareInfo.IndexOf(s.Name ?? "", text, CompareOptions.IgnoreCase) >= 0));
        }
Ejemplo n.º 5
0
 public bool Test(OGLContext context)
 {
     if (Name.ToLowerInvariant().Contains(context.Search))
     {
         return(true);
     }
     if (Description != null && Description.ToLowerInvariant().Contains(context.Search))
     {
         return(true);
     }
     if (Keywords != null && Keywords.Exists(k => k.Name == context.Search))
     {
         return(true);
     }
     if (Descriptions != null && Descriptions.Exists(d => d.Test(context)))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 6
0
        public AssemblyList(string directory, bool recurse)
        {
            IsWindows = STEM.Sys.Control.IsWindows;
            IsX64     = STEM.Sys.Control.IsX64;

            base.Path = directory;

            directory = System.IO.Path.GetFullPath(directory);

            foreach (string s in STEM.Sys.IO.Directory.STEM_GetFiles(directory, "*.dll|*.so|*.a|*.lib", "!.Archive|!TEMP", recurse ? System.IO.SearchOption.AllDirectories : System.IO.SearchOption.TopDirectoryOnly, false))
            {
                if (!Descriptions.Exists(i => i.Filename == s.Substring(directory.Length).Trim(System.IO.Path.DirectorySeparatorChar)))
                {
                    try
                    {
                        Descriptions.Add(new Sys.IO.FileDescription(directory, s.Substring(directory.Length).Trim(System.IO.Path.DirectorySeparatorChar), false));
                    }
                    catch { }
                }
            }
        }