void FileSection_IndexChanged(object sender, FileSection.IndexChangedEventArgs e) { if (sender != this && Parent != null && Parent.IndexChanged != null) { Parent.IndexChanged(this, e); } }
void Parent_IndexChanged(object sender, FileSection.IndexChangedEventArgs e) { int displacement = e.Displacement; if (displacement < -(ei + e.Location)) { displacement = -(ei + e.Location); } if (e.Location > ei) //if the changed location is further down than this section extends, it does not affect it { return; } if (e.Location <= si) { si += displacement; } ei += displacement; }