void VerifyAttackRangeAdornerInitialized()
        {
            if (null != this.AdornerLayer &&
                null == this.attackRangeAdorner &&
                0 < this.MaxAttackRange)
            {
                this.attackRangeAdorner = new BuildingAttackRangeAdorner(this);

                Binding maxAttackRangeBinding = new Binding("MaxAttackRange");
                maxAttackRangeBinding.Source = this;

                this.attackRangeAdorner.SetBinding(BuildingAttackRangeAdorner.MaxRangeProperty, maxAttackRangeBinding);

                Binding minAttackRangeBinding = new Binding("MinAttackRange");
                minAttackRangeBinding.Source = this;

                this.attackRangeAdorner.SetBinding(BuildingAttackRangeAdorner.MinRangeProperty, minAttackRangeBinding);

                Binding showAttackRangeLayerBinding = new Binding("ShowAttackRangeLayer");
                showAttackRangeLayerBinding.Source = this;

                this.attackRangeAdorner.SetBinding(BuildingAttackRangeAdorner.ShowAttackRangeLayerProperty, showAttackRangeLayerBinding);

                this.AdornerLayer.Add(this.attackRangeAdorner);
            }
        }
 void VerifyAttackRangeAdornerCleared()
 {
     if (null != this.AdornerLayer &&
         null != this.attackRangeAdorner)
     {
         this.AdornerLayer.Remove(this.attackRangeAdorner);
         this.attackRangeAdorner = null;
     }
 }
Ejemplo n.º 3
0
        void VerifyAttackRangeAdornerInitialized()
        {
            if (null != this.AdornerLayer &&
                null == this.attackRangeAdorner &&
                0 < this.MaxAttackRange)
            {
                this.attackRangeAdorner = new BuildingAttackRangeAdorner(this);

                Binding maxAttackRangeBinding = new Binding("MaxAttackRange");
                maxAttackRangeBinding.Source = this;

                this.attackRangeAdorner.SetBinding(BuildingAttackRangeAdorner.MaxRangeProperty, maxAttackRangeBinding);

                Binding minAttackRangeBinding = new Binding("MinAttackRange");
                minAttackRangeBinding.Source = this;

                this.attackRangeAdorner.SetBinding(BuildingAttackRangeAdorner.MinRangeProperty, minAttackRangeBinding);

                Binding showAttackRangeLayerBinding = new Binding("ShowAttackRangeLayer");
                showAttackRangeLayerBinding.Source = this;

                this.attackRangeAdorner.SetBinding(BuildingAttackRangeAdorner.ShowAttackRangeLayerProperty, showAttackRangeLayerBinding);

                this.AdornerLayer.Add(this.attackRangeAdorner);
            }
        }
Ejemplo n.º 4
0
 void VerifyAttackRangeAdornerCleared()
 {
     if (null != this.AdornerLayer &&
         null != this.attackRangeAdorner)
     {
         this.AdornerLayer.Remove(this.attackRangeAdorner);
         this.attackRangeAdorner = null;
     }
 }