Exemple #1
0
        public void ModifyAt(int _indParent, int _indChild)
        {
            ListWithChildEventArgs <T1, T2> evargs =
                new ListWithChildEventArgs <T1, T2>(this[_indParent], this.child[_indChild], _indParent);

            if (this.OnModify != null)
            {
                OnModify.Invoke(this, evargs);
            }

            this.child[_indChild] = evargs.ChildItem;
        }
Exemple #2
0
        void points_OnAdd(object sender, EventArgs e)
        {
            ListWithChild <Point3D, float>          list   = sender as ListWithChild <Point3D, float>;
            ListWithChildEventArgs <Point3D, float> evargs = e as ListWithChildEventArgs <Point3D, float>;

            if (list == null || evargs == null)
            {
                return;
            }

            evargs.ChildItem = (float)evargs.ParentItem.X;
        }
Exemple #3
0
        public void Add(T1 _item, T2 _childItem)
        {
            base.Add(_item);

            ListWithChildEventArgs <T1, T2> evargs = new ListWithChildEventArgs <T1, T2>(_item, _childItem, this.Count - 1);

            if (this.OnAdd != null)
            {
                OnAdd.Invoke(this, evargs);
            }

            T2 modifiedChildItem = evargs.ChildItem;

            this.child.Add(modifiedChildItem);
        }