這是我們要處理的方法,它從它的參數需要的所有是,EventArgs的,因此它可以從它如何避免直接致電事件?
private void sshResults_ButtonClicked(object eventSender, EditorNotifyEventArgs eventArgs)
但消費者呼籲像這樣得到傳播的行和列:
this.sshResults_ButtonClicked(null, new EditorNotifyEventArgs(new SpreadView(), null, Row - 1,Column - 1));
我不想這樣稱呼,只是傳遞行和列的資源太多。 什麼是重寫這個的好方法?也許我可以創建另一個方法,將第一個方法的全部副本粘貼到它中,並將行和列傳遞給它?那麼它會導致代碼冗餘?有500個地方我們正在使用sshResults_ButtonClicked,但我只是想改變上面提到的一個,所以我不想擺脫sshResults_ButtonClicked。
謝謝,但我的目標是不使用新的EditorNotifyEventArgs(新的SpreadView()部分。 – Bohn 2012-03-01 22:11:33
添加更多描述的答案:) – 2012-03-01 22:18:23