コード例 #1
0
    public override void ProcessStyles(FeatureTypeStyleCollection styles)
    {
      if (styles.Count > 0)
      {
        FeatureTypeStyleCollection newStyles = new FeatureTypeStyleCollection();

        foreach (FeatureTypeStyle style in styles)
        {
          for (int ri = 0; ri < style.Rules.Count; ri++)
          {
            Rule rule = style.Rules[ri];

            for (int si = 0; si < rule.Symbolizers.Count; si++)
            {
              Symbolizer sym = rule.Symbolizers[si];
              Dictionary<string, string> props = sym.Tag as Dictionary<string, string>;

              if (props != null && props.ContainsKey("comp-op"))
              {
                // Create new style and copy all previous rules.
                FeatureTypeStyle newStyle = CopyStyle(style, 0, ri + 1, si);
                newStyles.Add(newStyle);

                FeatureTypeStyle newStyle2 = new FeatureTypeStyle(style.Name + "_comp-op_" + props["comp-op"]);
                newStyle2.BlendingOptions.CompositingMode = ToCompositingMode(props["comp-op"]);
                Rule newRule = CopyRule(rule);
                newRule.Symbolizers.Add(sym);
                newStyle2.Rules.Add(newRule);

                newStyles.Add(newStyle2);

                rule.Symbolizers.RemoveRange(0, si + 1);

                style.Rules.RemoveRange(0, ri + 1);
                ri = -1;

                break;
              }
            }
          }

          if (style.Rules.Count > 0)
            newStyles.Add(style);
        }

        if (newStyles.Count > styles.Count)
        {
          styles.Clear();
          styles.AddRange(newStyles);
        }
      }
    }
コード例 #2
0
 public abstract void ProcessStyles(FeatureTypeStyleCollection styles);
コード例 #3
0
 public override void ProcessStyles(FeatureTypeStyleCollection styles)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 public abstract void ProcessStyles(FeatureTypeStyleCollection styles);