by SGFraW » Fri, 17 Dec 2004 02:23:05
Hi Stefan,
Thanks for your answer, but it was not really what I was looking for.
I finally redirect the three save action events to "home made" events in my
default console with the following code:
// Create a public event
public event InvokedActionEventHandler Saving;
public event PerformedActionEventHandler Saved;
void AuthoringReeditSaveAction1_InvokedAction(Object sender,ActionEventArgs
e) {
Saving(sender, e);}
void AuthoringReeditSaveAndExitAction1_InvokedAction(Object
sender,ActionEventArgs e) {
Saving(sender, e);}
void AuthoringSaveNewAction1_InvokedAction(Object sender,ActionEventArgs e) {
Saving(sender, e);}
void AuthoringReeditSaveAction1_PerformedAction(Object
sender,ActionEventArgs e) {
Saved(sender, e);}
void AuthoringReeditSaveAndExitAction1_PerformedAction(Object
sender,ActionEventArgs e) {
Saved(sender, e);}
void AuthoringSaveNewAction1_PerformedAction(Object sender,ActionEventArgs
e) {
Saved(sender, e);}
and register my events in InitializeComponent()
this.AuthoringReeditSaveAction1.InvokedAction += new
InvokedActionEventHandler(this.AuthoringReeditSaveAction1_InvokedAction);
this.AuthoringReeditSaveAndExitAction1.InvokedAction += new
InvokedActionEventHandler(this.AuthoringReeditSaveAndExitAction1_InvokedAction);
this.AuthoringSaveNewAction1.InvokedAction += new
InvokedActionEventHandler(this.AuthoringSaveNewAction1_InvokedAction);
this.AuthoringReeditSaveAction1.PerformedAction += new
PerformedActionEventHandler(this.AuthoringReeditSaveAction1_PerformedAction);
this.AuthoringReeditSaveAndExitAction1.PerformedAction += new
PerformedActionEventHandler(this.AuthoringReeditSaveAndExitAction1_PerformedAction);
this.AuthoringSaveNewAction1.PerformedAction += new
PerformedActionEventHandler(this.AuthoringSaveNewAction1_PerformedAction);
and now, I am able to customize my template behavior on the "saving" or
"saved" event by writing my event handler:
public void DefaultConsole1_Saved(object sender, ActionEventArgs e) {
...
}
which is also registered in InitializeComponent()
this.DefaultConsole1.Saved += new
PerformedActionEventHandler(this.DefaultConsole1_Saved);
Hope I didn't miss anything important, and that it might help somebody else.
Hakim