Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
[Gtk] Use the same event handler for model events.
Browse files Browse the repository at this point in the history
  • Loading branch information
Therzok committed Sep 19, 2016
1 parent 49056c0 commit ac98d1b
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions gtk/TreeEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ internal class TreeEnumerator : IEnumerator, IDisposable
public TreeEnumerator (TreeModel model)
{
this.model = model;
model.RowChanged += row_changed;
model.RowDeleted += row_deleted;
model.RowInserted += row_inserted;
model.RowsReordered += rows_reordered;
model.RowChanged += row_event;
model.RowDeleted += row_event;
model.RowInserted += row_event;
model.RowsReordered += row_event;
}

public object Current
Expand Down Expand Up @@ -75,32 +75,17 @@ public void Reset()
changed = false;
}

private void row_changed(object o, RowChangedArgs args)
{
changed = true;
}

private void row_deleted(object o, RowDeletedArgs args)
{
changed = true;
}

private void row_inserted(object o, RowInsertedArgs args)
{
changed = true;
}

private void rows_reordered(object o, RowsReorderedArgs args)
private void row_event(object o, EventArgs args)
{
changed = true;
}

public void Dispose ()
{
model.RowChanged -= row_changed;
model.RowDeleted -= row_deleted;
model.RowInserted -= row_inserted;
model.RowsReordered -= rows_reordered;
model.RowChanged -= row_event;
model.RowDeleted -= row_event;
model.RowInserted -= row_event;
model.RowsReordered -= row_event;
model = null;
}
}
Expand Down

0 comments on commit ac98d1b

Please sign in to comment.