Esempio n. 1
0
        private void OnDeleted(object item)
        {
            RTargetItemPanel panel = (RTargetItemPanel)item;

            if (panel.TargetItem != null)
            {
                if (this.Scope == null)
                {
                    this.Scope = GetNewScope();
                }
                panel.TargetItem.parent = this.Scope;
                //this.Scope.RemoveTargetItem(panel.TargetItem);
                this.panel.Children.Remove(panel);
                if (this.ActiveItemPanel != null && this.ActiveItemPanel == panel)
                {
                    this.ActiveItemPanel = (RTargetItemPanel)this.panel.Children[this.panel.Children.Count - 1];
                }
                int index = 1;
                foreach (object pan in this.panel.Children)
                {
                    ((RTargetItemPanel)pan).Index = index++;
                }
                if (Changed != null)
                {
                    Changed();
                }
                if (ItemDeleted != null && panel.TargetItem != null)
                {
                    ItemDeleted(panel.TargetItem);
                }
            }
        }
Esempio n. 2
0
 private void DisplayScope(Target scope, bool isNoAllocation = false)
 {
     this.Scope = scope;
     foreach (TargetItem item in scope.targetItemListChangeHandler.Items)
     {
         RTargetItemPanel itemPanel = new RTargetItemPanel(item, isNoAllocation);
         //if (this.IsReadOnly) itemPanel.SetReadOnly(this.IsReadOnly);
         AddItemPanel(itemPanel);
     }
 }
Esempio n. 3
0
 protected void AddItemPanel(RTargetItemPanel itemPanel)
 {
     itemPanel.Added           += OnAdded;
     itemPanel.Updated         += OnUpdated;
     itemPanel.Deleted         += OnDeleted;
     itemPanel.Activated       += OnActivated;
     itemPanel.ValidateFormula += OnValidateFormula;
     //itemPanel.Expand(IsExpanded);
     this.panel.Children.Add(itemPanel);
 }
Esempio n. 4
0
        private void OnUpdated(object item)
        {
            RTargetItemPanel panel = (RTargetItemPanel)item;

            if (this.Scope == null)
            {
                this.Scope = GetNewScope();
            }
            this.Scope.UpdateTargetItem(panel.TargetItem);
            OnChanged(panel.TargetItem);
        }
Esempio n. 5
0
        private void OnValidateFormula(object item)
        {
            RTargetItemPanel panel = (RTargetItemPanel)item;

            OnChanged(panel.TargetItem);
        }
Esempio n. 6
0
        private void OnActivated(object item)
        {
            RTargetItemPanel panel = (RTargetItemPanel)item;

            this.ActiveItemPanel = panel;
        }