Skip to content

Commit

Permalink
Update behavior of auto generation of listeners (masesgroup#220)
Browse files Browse the repository at this point in the history
* Added method indexer at the end of handlers to distinguish clashing methods

* Completely changed the format of auto generated listeners

* Update code after change format of listeners
  • Loading branch information
masesdevelopers authored Oct 18, 2023
1 parent ef1937f commit acc33d3
Show file tree
Hide file tree
Showing 145 changed files with 1,385 additions and 1,300 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public partial class FlavorListener : Java.Awt.Datatransfer.IFlavorListener
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("flavorsChanged", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Datatransfer.FlavorEvent>>>(FlavorsChangedEventHandler)); OnFlavorsChanged = FlavorsChanged;
AddEventHandler("flavorsChanged", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Datatransfer.FlavorEvent>>>(FlavorsChangedEventHandler));

}

Expand All @@ -84,7 +84,8 @@ protected virtual void InitializeHandlers()

void FlavorsChangedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Datatransfer.FlavorEvent>> data)
{
if (OnFlavorsChanged != null) OnFlavorsChanged.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnFlavorsChanged != null) ? OnFlavorsChanged : FlavorsChanged;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public partial class AppForegroundListener : Java.Awt.DesktopNs.IAppForegroundLi
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("appMovedToBackground", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppForegroundEvent>>>(AppMovedToBackgroundEventHandler)); OnAppMovedToBackground = AppMovedToBackground;
AddEventHandler("appRaisedToForeground", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppForegroundEvent>>>(AppRaisedToForegroundEventHandler)); OnAppRaisedToForeground = AppRaisedToForeground;
AddEventHandler("appMovedToBackground", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppForegroundEvent>>>(AppMovedToBackgroundEventHandler));
AddEventHandler("appRaisedToForeground", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppForegroundEvent>>>(AppRaisedToForegroundEventHandler));

}

Expand All @@ -90,7 +90,8 @@ protected virtual void InitializeHandlers()

void AppMovedToBackgroundEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppForegroundEvent>> data)
{
if (OnAppMovedToBackground != null) OnAppMovedToBackground.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnAppMovedToBackground != null) ? OnAppMovedToBackground : AppMovedToBackground;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -109,7 +110,8 @@ public virtual void AppMovedToBackground(Java.Awt.DesktopNs.AppForegroundEvent a

void AppRaisedToForegroundEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppForegroundEvent>> data)
{
if (OnAppRaisedToForeground != null) OnAppRaisedToForeground.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnAppRaisedToForeground != null) ? OnAppRaisedToForeground : AppRaisedToForeground;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
10 changes: 6 additions & 4 deletions src/net/JNet/Generated/Java/Awt/DesktopNs/AppHiddenListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public partial class AppHiddenListener : Java.Awt.DesktopNs.IAppHiddenListener
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("appHidden", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppHiddenEvent>>>(AppHiddenEventHandler)); OnAppHidden = AppHidden;
AddEventHandler("appUnhidden", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppHiddenEvent>>>(AppUnhiddenEventHandler)); OnAppUnhidden = AppUnhidden;
AddEventHandler("appHidden", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppHiddenEvent>>>(AppHiddenEventHandler));
AddEventHandler("appUnhidden", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppHiddenEvent>>>(AppUnhiddenEventHandler));

}

Expand All @@ -90,7 +90,8 @@ protected virtual void InitializeHandlers()

void AppHiddenEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppHiddenEvent>> data)
{
if (OnAppHidden != null) OnAppHidden.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnAppHidden != null) ? OnAppHidden : AppHidden;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -109,7 +110,8 @@ public virtual void AppHidden(Java.Awt.DesktopNs.AppHiddenEvent arg0)

void AppUnhiddenEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppHiddenEvent>> data)
{
if (OnAppUnhidden != null) OnAppUnhidden.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnAppUnhidden != null) ? OnAppUnhidden : AppUnhidden;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public partial class AppReopenedListener : Java.Awt.DesktopNs.IAppReopenedListen
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("appReopened", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppReopenedEvent>>>(AppReopenedEventHandler)); OnAppReopened = AppReopened;
AddEventHandler("appReopened", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppReopenedEvent>>>(AppReopenedEventHandler));

}

Expand All @@ -84,7 +84,8 @@ protected virtual void InitializeHandlers()

void AppReopenedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.AppReopenedEvent>> data)
{
if (OnAppReopened != null) OnAppReopened.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnAppReopened != null) ? OnAppReopened : AppReopened;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
10 changes: 6 additions & 4 deletions src/net/JNet/Generated/Java/Awt/DesktopNs/ScreenSleepListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public partial class ScreenSleepListener : Java.Awt.DesktopNs.IScreenSleepListen
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("screenAboutToSleep", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.ScreenSleepEvent>>>(ScreenAboutToSleepEventHandler)); OnScreenAboutToSleep = ScreenAboutToSleep;
AddEventHandler("screenAwoke", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.ScreenSleepEvent>>>(ScreenAwokeEventHandler)); OnScreenAwoke = ScreenAwoke;
AddEventHandler("screenAboutToSleep", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.ScreenSleepEvent>>>(ScreenAboutToSleepEventHandler));
AddEventHandler("screenAwoke", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.ScreenSleepEvent>>>(ScreenAwokeEventHandler));

}

Expand All @@ -90,7 +90,8 @@ protected virtual void InitializeHandlers()

void ScreenAboutToSleepEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.ScreenSleepEvent>> data)
{
if (OnScreenAboutToSleep != null) OnScreenAboutToSleep.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnScreenAboutToSleep != null) ? OnScreenAboutToSleep : ScreenAboutToSleep;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -109,7 +110,8 @@ public virtual void ScreenAboutToSleep(Java.Awt.DesktopNs.ScreenSleepEvent arg0)

void ScreenAwokeEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.ScreenSleepEvent>> data)
{
if (OnScreenAwoke != null) OnScreenAwoke.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnScreenAwoke != null) ? OnScreenAwoke : ScreenAwoke;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
10 changes: 6 additions & 4 deletions src/net/JNet/Generated/Java/Awt/DesktopNs/SystemSleepListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public partial class SystemSleepListener : Java.Awt.DesktopNs.ISystemSleepListen
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("systemAboutToSleep", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.SystemSleepEvent>>>(SystemAboutToSleepEventHandler)); OnSystemAboutToSleep = SystemAboutToSleep;
AddEventHandler("systemAwoke", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.SystemSleepEvent>>>(SystemAwokeEventHandler)); OnSystemAwoke = SystemAwoke;
AddEventHandler("systemAboutToSleep", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.SystemSleepEvent>>>(SystemAboutToSleepEventHandler));
AddEventHandler("systemAwoke", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.SystemSleepEvent>>>(SystemAwokeEventHandler));

}

Expand All @@ -90,7 +90,8 @@ protected virtual void InitializeHandlers()

void SystemAboutToSleepEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.SystemSleepEvent>> data)
{
if (OnSystemAboutToSleep != null) OnSystemAboutToSleep.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnSystemAboutToSleep != null) ? OnSystemAboutToSleep : SystemAboutToSleep;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -109,7 +110,8 @@ public virtual void SystemAboutToSleep(Java.Awt.DesktopNs.SystemSleepEvent arg0)

void SystemAwokeEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.SystemSleepEvent>> data)
{
if (OnSystemAwoke != null) OnSystemAwoke.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnSystemAwoke != null) ? OnSystemAwoke : SystemAwoke;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
10 changes: 6 additions & 4 deletions src/net/JNet/Generated/Java/Awt/DesktopNs/UserSessionListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public partial class UserSessionListener : Java.Awt.DesktopNs.IUserSessionListen
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("userSessionActivated", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.UserSessionEvent>>>(UserSessionActivatedEventHandler)); OnUserSessionActivated = UserSessionActivated;
AddEventHandler("userSessionDeactivated", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.UserSessionEvent>>>(UserSessionDeactivatedEventHandler)); OnUserSessionDeactivated = UserSessionDeactivated;
AddEventHandler("userSessionActivated", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.UserSessionEvent>>>(UserSessionActivatedEventHandler));
AddEventHandler("userSessionDeactivated", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.UserSessionEvent>>>(UserSessionDeactivatedEventHandler));

}

Expand All @@ -90,7 +90,8 @@ protected virtual void InitializeHandlers()

void UserSessionActivatedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.UserSessionEvent>> data)
{
if (OnUserSessionActivated != null) OnUserSessionActivated.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnUserSessionActivated != null) ? OnUserSessionActivated : UserSessionActivated;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -109,7 +110,8 @@ public virtual void UserSessionActivated(Java.Awt.DesktopNs.UserSessionEvent arg

void UserSessionDeactivatedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.DesktopNs.UserSessionEvent>> data)
{
if (OnUserSessionDeactivated != null) OnUserSessionDeactivated.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnUserSessionDeactivated != null) ? OnUserSessionDeactivated : UserSessionDeactivated;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions src/net/JNet/Generated/Java/Awt/Dnd/DragGestureListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public partial class DragGestureListener : Java.Awt.Dnd.IDragGestureListener
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("dragGestureRecognized", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragGestureEvent>>>(DragGestureRecognizedEventHandler)); OnDragGestureRecognized = DragGestureRecognized;
AddEventHandler("dragGestureRecognized", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragGestureEvent>>>(DragGestureRecognizedEventHandler));

}

Expand All @@ -84,7 +84,8 @@ protected virtual void InitializeHandlers()

void DragGestureRecognizedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragGestureEvent>> data)
{
if (OnDragGestureRecognized != null) OnDragGestureRecognized.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDragGestureRecognized != null) ? OnDragGestureRecognized : DragGestureRecognized;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
30 changes: 18 additions & 12 deletions src/net/JNet/Generated/Java/Awt/Dnd/DragSourceAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public partial class DragSourceAdapter
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("dragDropEnd", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDropEvent>>>(DragDropEndEventHandler)); OnDragDropEnd = DragDropEnd;
AddEventHandler("dragEnter", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DragEnterEventHandler)); OnDragEnter = DragEnter;
AddEventHandler("dragExit", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceEvent>>>(DragExitEventHandler)); OnDragExit = DragExit;
AddEventHandler("dragMouseMoved", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DragMouseMovedEventHandler)); OnDragMouseMoved = DragMouseMoved;
AddEventHandler("dragOver", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DragOverEventHandler)); OnDragOver = DragOver;
AddEventHandler("dropActionChanged", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DropActionChangedEventHandler)); OnDropActionChanged = DropActionChanged;
AddEventHandler("dragDropEnd", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDropEvent>>>(DragDropEndEventHandler));
AddEventHandler("dragEnter", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DragEnterEventHandler));
AddEventHandler("dragExit", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceEvent>>>(DragExitEventHandler));
AddEventHandler("dragMouseMoved", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DragMouseMovedEventHandler));
AddEventHandler("dragOver", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DragOverEventHandler));
AddEventHandler("dropActionChanged", new System.EventHandler<CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>>>(DropActionChangedEventHandler));

}

Expand All @@ -66,7 +66,8 @@ protected virtual void InitializeHandlers()

void DragDropEndEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDropEvent>> data)
{
if (OnDragDropEnd != null) OnDragDropEnd.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDragDropEnd != null) ? OnDragDropEnd : DragDropEnd;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -85,7 +86,8 @@ public virtual void DragDropEnd(Java.Awt.Dnd.DragSourceDropEvent arg0)

void DragEnterEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>> data)
{
if (OnDragEnter != null) OnDragEnter.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDragEnter != null) ? OnDragEnter : DragEnter;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -104,7 +106,8 @@ public virtual void DragEnter(Java.Awt.Dnd.DragSourceDragEvent arg0)

void DragExitEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceEvent>> data)
{
if (OnDragExit != null) OnDragExit.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDragExit != null) ? OnDragExit : DragExit;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -123,7 +126,8 @@ public virtual void DragExit(Java.Awt.Dnd.DragSourceEvent arg0)

void DragMouseMovedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>> data)
{
if (OnDragMouseMoved != null) OnDragMouseMoved.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDragMouseMoved != null) ? OnDragMouseMoved : DragMouseMoved;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -142,7 +146,8 @@ public virtual void DragMouseMoved(Java.Awt.Dnd.DragSourceDragEvent arg0)

void DragOverEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>> data)
{
if (OnDragOver != null) OnDragOver.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDragOver != null) ? OnDragOver : DragOver;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand All @@ -161,7 +166,8 @@ public virtual void DragOver(Java.Awt.Dnd.DragSourceDragEvent arg0)

void DropActionChangedEventHandler(object sender, CLRListenerEventArgs<CLREventData<Java.Awt.Dnd.DragSourceDragEvent>> data)
{
if (OnDropActionChanged != null) OnDropActionChanged.Invoke(data.EventData.TypedEventData);
var methodToExecute = (OnDropActionChanged != null) ? OnDropActionChanged : DropActionChanged;
methodToExecute.Invoke(data.EventData.TypedEventData);
}

/// <summary>
Expand Down
Loading

0 comments on commit acc33d3

Please sign in to comment.