コード例 #1
0
        private void OnDeleted(object item)
        {
            RPeriodItemPanel panel = (RPeriodItemPanel)item;

            if (panel.PeriodItem == null)
            {
                return;
            }
            if (this.Period == null)
            {
                this.Period = GetNewPeriod();
            }
            if (panel.PeriodItem.isInValidDefault())
            {
                if (this.panel.Children.Count > 1 && panel.Index >= 0)
                {
                    this.panel.Children.RemoveAt(panel.Index);
                }
                return;
            }

            if (this.Period.Contains(panel.PeriodItem))
            {
                if (ItemDeleted != null && panel.PeriodItem != null)
                {
                    ItemDeleted(panel.PeriodItem);
                }
            }
            else
            {
            }
        }
コード例 #2
0
 private void OnAdd(object item)
 {
     if (Added != null)
     {
         RPeriodItemPanel panel = (RPeriodItemPanel)item;
         panel.PeriodItem.name = GetPeriodName();
         Added(item);
     }
 }
コード例 #3
0
 private void OnValidateFormula(object item)
 {
     if (ValidateFormula != null)
     {
         RPeriodItemPanel panel = (RPeriodItemPanel)item;
         panel.PeriodItem.name = GetPeriodName();
         ValidateFormula(item);
     }
 }
コード例 #4
0
 private void OnUpdate(object item)
 {
     if (Updated != null)
     {
         RPeriodItemPanel panel = (RPeriodItemPanel)item;
         panel.PeriodItem.name = GetPeriodName();
         Updated(item);
     }
 }
コード例 #5
0
        private void OnAdded(object item)
        {
            RPeriodItemPanel panel = (RPeriodItemPanel)item;

            if (this.Period == null)
            {
                this.Period = GetNewPeriod();
            }
            if (panel.PeriodItem != null)
            {
                this.Period.AddPeriodItem(panel.PeriodItem);
                OnChanged(panel.PeriodItem);
            }
        }
コード例 #6
0
 private void OnDelete(object item)
 {
     if (Deleted != null)
     {
         RPeriodItemPanel panel = (RPeriodItemPanel)item;
         if (this.ItemPanel2.PeriodItem != null)
         {
             this.ItemPanel2.PeriodItem.name = GetPeriodName();
             Deleted(this.ItemPanel2);
         }
         if (this.ItemPanel1.PeriodItem != null)
         {
             this.ItemPanel1.PeriodItem.name = GetPeriodName();
             Deleted(this.ItemPanel1);
         }
     }
 }
コード例 #7
0
        private void OnUpdated(object item)
        {
            RPeriodItemPanel panel = (RPeriodItemPanel)item;

            if (this.Period == null)
            {
                this.Period = GetNewPeriod();
            }
            if (this.Period.itemListChangeHandler.Items.Contains(panel.PeriodItem))
            {
                this.Period.UpdatePeriodItem(panel.PeriodItem);
            }
            else
            {
                this.Period.AddPeriodItem(panel.PeriodItem);
            }
            OnChanged(panel.PeriodItem);
        }