public override void Dispose () { if (this.widget != null) { this.widget.Destroy (); this.widget = null; } if (leftwatcher != null) { leftwatcher.Dispose (); leftwatcher = null; } if (rightwatcher != null) { rightwatcher.Dispose (); rightwatcher = null; } box.Destroy (); base.Dispose (); }
private void Refresh() { box.Show(); try { if (left is string) diff = new Diff((string)left, (string)right, true, true); else if (left is string[]) diff = new Diff((string[])left, (string[])right, null, null); } catch (Exception e) { Console.Error.WriteLine(e.ToString()); return; } if (widget != null) { pos = widget.Position; box.Remove(widget); widget.Dispose(); } DiffWidget.Options opts = new DiffWidget.Options(); opts.Font = DesktopService.DefaultMonospaceFont; opts.LeftName = "Repository"; opts.RightName = "Working Copy"; widget = new DiffWidget(diff, opts); box.Add(widget); box.ShowAll(); widget.ExposeEvent += new ExposeEventHandler(OnExposed); }