mono-examples: Adapt to latest syntax (EventArgs.arg -> Arg)

Also workaround some temporary inability to set struct members.
This commit is contained in:
Xavi Artigas 2020-02-07 09:49:57 +01:00
parent dfa678e9dc
commit 6a470840d9
11 changed files with 16 additions and 25 deletions

View File

@ -14,7 +14,7 @@ public class Calculator : Efl.Csharp.Application
// Quits the application
private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ea)
{
if (ea.arg == false)
if (ea.Arg == false)
Efl.App.AppMain.Quit(0);
}

View File

@ -14,14 +14,14 @@ public class LifeWindow : Efl.Csharp.Application
void QuitEvent(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ev)
{
// quit the mainloop
if (ev.arg == false)
if (ev.Arg == false)
Efl.App.AppMain.Quit(0);
}
void TouchEvent(object sender, Efl.Input.InterfacePointerDownEventArgs ev)
{
int cellx, celly;
var position = ev.arg.GetPosition();
var position = ev.Arg.GetPosition();
lifeRender.CellForCoords(win, position, out cellx, out celly);
int i = LifeBoard.IndexForPosition(cellx, celly);
@ -31,7 +31,7 @@ public class LifeWindow : Efl.Csharp.Application
void KeyDownEvent(object sender, Efl.Input.InterfaceKeyDownEventArgs ev)
{
if (ev.arg.GetKeySym() == "space")
if (ev.Arg.GetKeySym() == "space")
lifeBoard.TogglePause(win);
}
@ -44,10 +44,6 @@ public class LifeWindow : Efl.Csharp.Application
// when the user clicks "close" on a window there is a request to hide
((Efl.Gfx.IEntity)win).VisibilityChangedEvent += QuitEvent;
Eina.Size2D sz;
sz.W = (int)(10 * LifeBoard.Width * win.GetScale());
sz.H = (int)(10 * LifeBoard.Height * win.GetScale());
lifeBoard = new LifeBoard();
lifeRender = new LifeRender(win, lifeBoard);
lifeRender.Refresh(win);
@ -56,7 +52,8 @@ public class LifeWindow : Efl.Csharp.Application
((Efl.Input.IInterface)win).PointerDownEvent += TouchEvent;
((Efl.Input.IInterface)win).KeyDownEvent += KeyDownEvent;
win.SetSize(sz);
win.SetSize(new Eina.Size2D((int)(10 * LifeBoard.Width * win.GetScale()),
(int)(10 * LifeBoard.Height * win.GetScale())));
lifeBoard.Run(win);
}

View File

@ -39,15 +39,9 @@ public class LifeRender
var rect = lifeCells[LifeBoard.IndexForPosition(x, y)];
// the little +1 here will avoid tearing as we layout non-multiple sizes
Eina.Size2D sz;
sz.W = (int)(cw + 1);
sz.H = (int)(ch + 1);
rect.SetSize(sz);
rect.SetSize(new Eina.Size2D((int)(cw + 1), (int)(ch + 1)));
Eina.Position2D pos;
pos.X = (int)(x * cw);
pos.Y = (int)(y * ch);
rect.SetPosition(pos);
rect.SetPosition(new Eina.Position2D((int)(x * cw), (int)(y * ch)));
}
}

View File

@ -55,7 +55,7 @@ class Application : Efl.Csharp.Application
void QuitEvt(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ev)
{
if (ev.arg == false)
if (ev.Arg == false)
{
Efl.App.AppMain.Quit(0);
}

View File

@ -34,7 +34,7 @@ public class TextEditor : Efl.Csharp.Application
// Quits the application
private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ea)
{
if (ea.arg == false)
if (ea.Arg == false)
Efl.App.AppMain.Quit(0);
}

View File

@ -15,7 +15,7 @@ public class Example : Efl.Csharp.Application
win.SetAutohide(true);
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop
if (e.arg == false)
if (e.Arg == false)
Efl.Ui.Config.Exit();
};

View File

@ -65,7 +65,7 @@ public class Example : Efl.Csharp.Application
win.SetAutohide(true);
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop
if (e.arg == false)
if (e.Arg == false)
Efl.Ui.Config.Exit();
};
// Give the window an initial size so there is room to resize the panes.

View File

@ -38,7 +38,7 @@ public class Example : Efl.Csharp.Application
win.SetAutohide(true);
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop when the window is closed
if (e.arg == false)
if (e.Arg == false)
Efl.Ui.Config.Exit();
};
// Give the window an initial size

View File

@ -18,7 +18,7 @@ public class Example : Efl.Csharp.Application
win.SetAutohide(true);
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
// Exit the EFL main loop
if (e.arg == false)
if (e.Arg == false)
Efl.Ui.Config.Exit();
};

View File

@ -6,7 +6,7 @@ public class Example : Efl.Csharp.Application
public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
{
// Exit the EFL main loop
if (e.arg == false)
if (e.Arg == false)
Efl.App.AppMain.Quit(0);
}

View File

@ -6,7 +6,7 @@ public class Example : Efl.Csharp.Application
public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
{
// Exit the EFL main loop
if (e.arg == false)
if (e.Arg == false)
Efl.App.AppMain.Quit(0);
}