コード例 #1
0
ファイル: ScopePanel.xaml.cs プロジェクト: schifflee/bcephal2
        private void OnDeleted(object item)
        {
            ScopeItemPanel panel = (ScopeItemPanel)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 = (ScopeItemPanel)this.panel.Children[this.panel.Children.Count - 1];
                }
                int index = 1;
                foreach (object pan in this.panel.Children)
                {
                    ((ScopeItemPanel)pan).Index = index++;
                }
                if (Changed != null)
                {
                    Changed();
                }
                if (ItemDeleted != null && panel.TargetItem != null)
                {
                    ItemDeleted(panel.TargetItem);
                }
            }
        }
コード例 #2
0
ファイル: ScopePanel.xaml.cs プロジェクト: schifflee/bcephal2
 protected void AddItemPanel(ScopeItemPanel itemPanel)
 {
     //itemPanel.Changed += OnChanged;
     itemPanel.Added     += OnAdded;
     itemPanel.Updated   += OnUpdated;
     itemPanel.Deleted   += OnDeleted;
     itemPanel.Activated += OnActivated;
     this.panel.Children.Add(itemPanel);
 }
コード例 #3
0
ファイル: ScopePanel.xaml.cs プロジェクト: schifflee/bcephal2
        private void OnUpdated(object item)
        {
            ScopeItemPanel panel = (ScopeItemPanel)item;

            if (this.Scope == null)
            {
                this.Scope = GetNewScope();
            }
            this.Scope.UpdateTargetItem(panel.TargetItem);
            OnChanged(panel.TargetItem);
        }
コード例 #4
0
ファイル: ScopePanel.xaml.cs プロジェクト: schifflee/bcephal2
        /// <summary>
        ///
        /// </summary>
        /// <param name="table"></param>
        public void DisplayScope(Target scope)
        {
            this.Scope = scope;
            this.panel.Children.Clear();
            int index = 1;

            if (scope == null)
            {
                AddDefaultLine(index, isCustomize);
                return;
            }
            foreach (TargetItem item in scope.targetItemListChangeHandler.Items)
            {
                ScopeItemPanel itemPanel = isCustomize ?  new ScopeItemPanel(item, isCustomize) : new ScopeItemPanel(item);
                itemPanel.SetReadOnly(this.isReadOnly);
                AddItemPanel(itemPanel);
                index++;
            }

            AddDefaultLine(index, isCustomize);
        }
コード例 #5
0
ファイル: ScopePanel.xaml.cs プロジェクト: schifflee/bcephal2
        private void OnActivated(object item)
        {
            ScopeItemPanel panel = (ScopeItemPanel)item;

            this.ActiveItemPanel = panel;
        }