public bool MatchesUser(User user) { if (user.Key != null) { if (Included != null && Included.Contains(user.Key)) { return(true); } if (Excluded != null && Excluded.Contains(user.Key)) { return(false); } if (Rules != null) { foreach (var rule in Rules) { if (rule.MatchesUser(user, this.Key, this.Salt)) { return(true); } } } } return(false); }
public static string GetAllContent(TAGBlock block) { string ret = string.Empty; if (block.Name == null) { return(ret); } if (!Excluded.Contains(block.Name)) { if (Titles.ContainsKey(block.Name)) { ret = DataResource.GetMarkFormatted(Titles[block.Name]); } ret = string.Format("{0}{1}", ret, block.content); if (block.FirstInside != null) { ret = string.Format("{0}{1}", ret, GetAllContent(block.FirstInside)); } } if (block.NextBlock != null) { ret = string.Format("{0}{1}", ret, GetAllContent(block.NextBlock)); } return(ret); }
internal static string MapExcludedType(string fullType) { if (Excluded.Contains(fullType)) { return(fullType); } return(ExcludedTypes.ContainsKey(fullType) ? ExcludedTypes[fullType] : null); }
private void ResetCurrentMonitorSetupSelection() { if (CurrentViewportSetup.ProfileName == null) { // special entry for unsaved profile, just remove it if (Combined.Contains(CurrentViewportSetup)) { Combined.Remove(CurrentViewportSetup); } else if (Excluded.Contains(CurrentViewportSetup)) { Excluded.Remove(CurrentViewportSetup); } } else { // keep it, but this is no longer the special entry for current CurrentViewportSetup.IsCurrentProfile = false; } }
public static string FindTXTContent(TAGBlock block) { if (block == null || block.Name == null) { return(string.Empty); } string ret = string.Empty; if (Included.Contains(block.Name) && !Excluded.Contains(block.Name)) { ret += (SplitHtml.GetAllInsideContent(block)); } else if (block.FirstInside != null && !Excluded.Contains(block.Name)) { ret += FindTXTContent(block.FirstInside); } if (block.NextBlock != null) { ret += FindTXTContent(block.NextBlock); } return(ret); }
private List <PropertyList> GetTypeProperties <T>(params ExclusionTypes[] Excluded) { List <PropertyList> modelProperties = typeof(T).GetProperties().Where(p => p.GetCustomAttributes(typeof(MappingAttribute), false).Count() <= 0 || p.GetCustomAttributes(typeof(MappingAttribute), false).Cast <MappingAttribute>().Any(a => !Excluded.Contains(a.Exclude))).OrderBy(p => p.MetadataToken) .Select(s => new PropertyList { PropertyName = s.Name, ColumnName = (s.GetCustomAttributes(typeof(MappingAttribute), false).Count() <= 0 ? s.Name : string.IsNullOrEmpty(s.GetCustomAttributes(typeof(MappingAttribute), false).Cast <MappingAttribute>().FirstOrDefault().ColumnName) ? s.Name : s.GetCustomAttributes(typeof(MappingAttribute), false).Cast <MappingAttribute>().FirstOrDefault().ColumnName), PropertyType = s.PropertyType, ParameterName = (s.GetCustomAttributes(typeof(MappingAttribute), false).Count() <= 0 ? s.Name : string.IsNullOrEmpty(s.GetCustomAttributes(typeof(MappingAttribute), false).Cast <MappingAttribute>().FirstOrDefault().ParameterName) ? s.Name : s.GetCustomAttributes(typeof(MappingAttribute), false).Cast <MappingAttribute>().FirstOrDefault().ParameterName.Replace("@", "")) }).ToList(); return(modelProperties); }
internal static bool IsExcludedType(string fullType) { return(Excluded.Contains(fullType) || ExcludedTypes.ContainsKey(fullType)); }
public IWeight GetWeight(E edge) => Excluded.Contains(edge) ? weigher.NonViableWeight : weigher.GetWeight(edge);