示例#1
0
 public FilterMapping GetFilterMapping()
 {
     var mapping = new FilterMapping();
     mapping.Name = Name;
     mapping.Condition = Condition;
     return mapping;
 }
 FilterMapping IFilterMappingProvider.GetFilterMapping()
 {
     var mapping = new FilterMapping();
     mapping.Set(x => x.Name, Layer.Defaults, Name);
     mapping.Set(x => x.Condition, Layer.Defaults, Condition);
     return mapping;
 }
 public void AddOrReplaceFilter(FilterMapping mapping)
 {
     var filter = filters.Find(x => x.Name == mapping.Name);
     if (filter != null)
         filters.Remove(filter);
     filters.Add(mapping);
 }
示例#4
0
 public void AddFilter(FilterMapping mapping)
 {
     if (Filters.Any(x => x.Name == mapping.Name))
     {
         throw new InvalidOperationException("Tried to add filter with name '" + mapping.Name + "' when already added.");
     }
     AddMapping(mapping, MappingType.Filter);
 }
        public void AddFilter(FilterMapping mapping)
        {
            if (filters.Exists(x => x.Name == mapping.Name))
            {
                throw new InvalidOperationException("Tried to add filter with name '" + mapping.Name + "' when already added.");
            }

            filters.Add(mapping);
        }
        public void AddOrReplaceFilter(FilterMapping mapping)
        {
            var filter = filters.Find(x => x.Name == mapping.Name);

            if (filter != null)
            {
                filters.Remove(filter);
            }
            filters.Add(mapping);
        }
 public void ShouldWriteTheFilter()
 {
     var filter = new FilterMapping();
     filter.Name = "sid";
     filter.Condition = "Fred = :george";
     XmlFilterWriter writer = new XmlFilterWriter();
     writer.VerifyXml(filter)
         .RootElement.HasName("filter")
         .HasAttribute("name", "sid")
         .HasAttribute("condition", "Fred = :george");
 }
 public bool Equals(FilterMapping other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.attributes, attributes));
 }
 public void ShouldWriteTheFilter()
 {
     var filter = new FilterMapping();
     filter.Set(x => x.Name, Layer.Defaults, "sid");
     filter.Set(x => x.Condition, Layer.Defaults, "Fred = :george");
     
     var writer = new XmlFilterWriter();
     writer.VerifyXml(filter)
         .RootElement.HasName("filter")
         .HasAttribute("name", "sid")
         .HasAttribute("condition", "Fred = :george");
 }
 public virtual void ProcessFilter(FilterMapping mapping)
 {
 }
 public virtual void Visit(FilterMapping mapping)
 {
 }
示例#12
0
 public virtual void Visit(FilterMapping mapping)
 {
 }
示例#13
0
 public virtual void ProcessFilter(FilterMapping mapping)
 {
 }
示例#14
0
 public void AddOrReplaceFilter(FilterMapping mapping)
 {
     AddOrReplaceMapping(mapping, MappingType.Filter, x => x.Name == mapping.Name);
 }
示例#15
0
 public FilterBuilder(FilterMapping mapping)
 {
     this.mapping = mapping;
 }
        public void AddFilter(FilterMapping mapping)
        {
            if (filters.Exists(x => x.Name == mapping.Name))
                throw new InvalidOperationException("Tried to add filter with name '" + mapping.Name + "' when already added.");

            filters.Add(mapping);
        }
示例#17
0
 public bool Equals(FilterMapping other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.attributes, attributes);
 }