public override void Bind(IEditorService service)
        {
            _init = true;
            try
            {
                _edsvc = service;
                _edsvc.RegisterCustomNotifier(this);
                _rl = (IRasterLayerDefinition)((ILayerDefinition)service.GetEditedResource()).SubLayer;

                _activeRange = _rl.GetScaleRangeAt(0);
                _colorStyle = _activeRange.ColorStyle;

                _backgroundColor = _colorStyle.GetColorRuleAt(0);
                _foregroundColor = _colorStyle.GetColorRuleAt(1);

                txtVisibleFrom.Text = (_activeRange.MinScale.HasValue ? _activeRange.MinScale.Value : 0).ToString();
                txtRebuildFactor.Text = _activeRange.RebuildFactor.ToString();
                cmbVisibleTo.Text = (_activeRange.MaxScale.HasValue ? _activeRange.MaxScale.Value.ToString() : Strings.Infinity);

                string fg = _foregroundColor.Color.GetValue();
                string bg = _backgroundColor.Color.GetValue();

                if (!string.IsNullOrEmpty(fg))
                    cmbForegroundColor.CurrentColor = Utility.ParseHTMLColor(fg);
                if (!string.IsNullOrEmpty(bg))
                    cmbBackgroundColor.CurrentColor = Utility.ParseHTMLColor(bg);
            }
            finally
            {
                _init = false;
            }
        }
Ejemplo n.º 2
0
        void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
        {
            var cr = rule as GridColorRuleType;

            if (cr != null)
            {
                this.ColorRule.Remove((GridColorRuleType)cr);
            }
        }
        public override void Bind(IEditorService service)
        {
            _init = true;
            try
            {
                _edsvc = service;
                _edsvc.RegisterCustomNotifier(this);
                _rl = (IRasterLayerDefinition)((ILayerDefinition)service.GetEditedResource()).SubLayer;

                _activeRange = _rl.GetScaleRangeAt(0);
                _colorStyle  = _activeRange.ColorStyle;

                _backgroundColor = _colorStyle.GetColorRuleAt(0);
                _foregroundColor = _colorStyle.GetColorRuleAt(1);

                txtVisibleFrom.Text   = (_activeRange.MinScale.HasValue ? _activeRange.MinScale.Value : 0).ToString();
                txtRebuildFactor.Text = _activeRange.RebuildFactor.ToString();
                cmbVisibleTo.Text     = (_activeRange.MaxScale.HasValue ? _activeRange.MaxScale.Value.ToString() : Strings.Infinity);

                string fg = _foregroundColor.Color.GetValue();
                string bg = _backgroundColor.Color.GetValue();

                if (!string.IsNullOrEmpty(fg))
                {
                    cmbForegroundColor.CurrentColor = Utility.ParseHTMLColor(fg);
                }
                if (!string.IsNullOrEmpty(bg))
                {
                    cmbBackgroundColor.CurrentColor = Utility.ParseHTMLColor(bg);
                }
            }
            finally
            {
                _init = false;
            }
        }
Ejemplo n.º 4
0
 void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
 {
     var cr = rule as GridColorRuleType;
     if (cr != null)
         this.ColorRule.Remove((GridColorRuleType)cr);
 }