예제 #1
0
        private void AddRuleButton_Click(object sender, EventArgs e)
        {
            if (m_point != null)
            {
                IPointRule prt = _factory.CreateDefaultPointRule();
                int        idx = m_point.RuleCount;
                conditionList.AddRuleControl(prt, idx).Focus();
                m_point.AddRule(prt);
            }
            else if (m_line != null)
            {
                ILineRule lrt = _factory.CreateDefaultLineRule();
                int       idx = m_line.RuleCount;
                conditionList.AddRuleControl(lrt, idx).Focus();
                m_line.AddRule(lrt);
            }
            else if (m_area != null)
            {
                IAreaRule art = _factory.CreateDefaultAreaRule();
                int       idx = m_area.RuleCount;
                conditionList.AddRuleControl(art, idx).Focus();
                m_area.AddRule(art);
            }
            else if (m_comp != null)
            {
                ICompositeRule cr  = _factory.CreateDefaultCompositeRule();
                int            idx = m_area.RuleCount;
                conditionList.AddRuleControl(cr, idx).Focus();
                m_comp.AddCompositeRule(cr);
            }

            ItemChanged?.Invoke(this, null);
        }
예제 #2
0
        public override ILabeledRuleModel CloneLabeledRuleModel(ILayerElementFactory factory)
        {
            var clone = factory.CreateDefaultAreaRule();

            clone.Filter      = _rule.Filter;
            clone.LegendLabel = _rule.LegendLabel;
            if (_rule.Label != null)
            {
                clone.Label = _rule.Label.Clone();
            }
            if (_rule.AreaSymbolization2D != null)
            {
                clone.AreaSymbolization2D = _rule.AreaSymbolization2D.Clone();
            }
            return(new AreaRuleModel(clone, -1));
        }
예제 #3
0
 private IAreaRule CreateAreaRule(IAreaRule template, ILayerElementFactory factory)
 {
     var arule = factory.CreateDefaultAreaRule();
     if (template.AreaSymbolization2D != null)
         arule.AreaSymbolization2D = template.AreaSymbolization2D.Clone();
     if (template.Label != null)
         arule.Label = template.Label.Clone();
     return arule;
 }