Renamed events and event handlers according to C# naming convention.
This commit is contained in:
parent
7c3fddd060
commit
75f104f136
18 changed files with 51 additions and 51 deletions
|
@ -52,7 +52,7 @@ namespace SafeExamBrowser.Browser
|
|||
public void RegisterApplicationButton(ITaskbarButton button)
|
||||
{
|
||||
this.button = button;
|
||||
this.button.OnClick += Button_OnClick;
|
||||
this.button.Clicked += Button_OnClick;
|
||||
}
|
||||
|
||||
public void Terminate()
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace SafeExamBrowser.Browser
|
|||
public string Name { get; private set; }
|
||||
public IWindow Window { get { return window; } }
|
||||
|
||||
public event TerminationEventHandler Terminated;
|
||||
public event TerminatedEventHandler Terminated;
|
||||
public event NameChangedEventHandler NameChanged;
|
||||
|
||||
public BrowserApplicationInstance(IBrowserSettings settings, IText text, IUserInterfaceFactory uiFactory, bool isMainInstance)
|
||||
|
|
|
@ -16,18 +16,18 @@ namespace SafeExamBrowser.Browser
|
|||
{
|
||||
class BrowserControl : ChromiumWebBrowser, IBrowserControl
|
||||
{
|
||||
private AddressChangedHandler addressChanged;
|
||||
private AddressChangedEventHandler addressChanged;
|
||||
private IBrowserSettings settings;
|
||||
private TitleChangedHandler titleChanged;
|
||||
private TitleChangedEventHandler titleChanged;
|
||||
private IText text;
|
||||
|
||||
event AddressChangedHandler IBrowserControl.AddressChanged
|
||||
event AddressChangedEventHandler IBrowserControl.AddressChanged
|
||||
{
|
||||
add { addressChanged += value; }
|
||||
remove { addressChanged -= value; }
|
||||
}
|
||||
|
||||
event TitleChangedHandler IBrowserControl.TitleChanged
|
||||
event TitleChangedEventHandler IBrowserControl.TitleChanged
|
||||
{
|
||||
add { titleChanged += value; }
|
||||
remove { titleChanged -= value; }
|
||||
|
|
|
@ -11,7 +11,7 @@ using SafeExamBrowser.Contracts.UserInterface;
|
|||
|
||||
namespace SafeExamBrowser.Contracts.Configuration
|
||||
{
|
||||
public delegate void TerminationEventHandler(Guid id);
|
||||
public delegate void TerminatedEventHandler(Guid id);
|
||||
public delegate void NameChangedEventHandler(string name);
|
||||
|
||||
public interface IApplicationInstance
|
||||
|
@ -29,7 +29,7 @@ namespace SafeExamBrowser.Contracts.Configuration
|
|||
/// <summary>
|
||||
/// Event fired when the application instance has been terminated.
|
||||
/// </summary>
|
||||
event TerminationEventHandler Terminated;
|
||||
event TerminatedEventHandler Terminated;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the name or (document) title of the application instance has changed.
|
||||
|
|
|
@ -10,7 +10,7 @@ using System;
|
|||
|
||||
namespace SafeExamBrowser.Contracts.Monitoring
|
||||
{
|
||||
public delegate void ExplorerStartedHandler();
|
||||
public delegate void ExplorerStartedEventHandler();
|
||||
|
||||
public interface IProcessMonitor
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ namespace SafeExamBrowser.Contracts.Monitoring
|
|||
/// Event fired when the process monitor observes that a new instance of
|
||||
/// the Windows explorer has been started.
|
||||
/// </summary>
|
||||
event ExplorerStartedHandler ExplorerStarted;
|
||||
event ExplorerStartedEventHandler ExplorerStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Performs a check whether the process associated to the given window is allowed.
|
||||
|
|
|
@ -10,14 +10,14 @@ using System;
|
|||
|
||||
namespace SafeExamBrowser.Contracts.Monitoring
|
||||
{
|
||||
public delegate void WindowChangedHandler(IntPtr window);
|
||||
public delegate void WindowChangedEventHandler(IntPtr window);
|
||||
|
||||
public interface IWindowMonitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when the window monitor observes that the foreground window has changed.
|
||||
/// </summary>
|
||||
event WindowChangedHandler WindowChanged;
|
||||
event WindowChangedEventHandler WindowChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Forcefully closes the specified window.
|
||||
|
|
|
@ -8,20 +8,20 @@
|
|||
|
||||
namespace SafeExamBrowser.Contracts.UserInterface
|
||||
{
|
||||
public delegate void AddressChangedHandler(string address);
|
||||
public delegate void TitleChangedHandler(string title);
|
||||
public delegate void AddressChangedEventHandler(string address);
|
||||
public delegate void TitleChangedEventHandler(string title);
|
||||
|
||||
public interface IBrowserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when the address of the browser control changes.
|
||||
/// </summary>
|
||||
event AddressChangedHandler AddressChanged;
|
||||
event AddressChangedEventHandler AddressChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the current page (and thus the title) of the browser control changes.
|
||||
/// </summary>
|
||||
event TitleChangedHandler TitleChanged;
|
||||
event TitleChangedEventHandler TitleChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the previous page in the browser control history.
|
||||
|
|
|
@ -8,29 +8,29 @@
|
|||
|
||||
namespace SafeExamBrowser.Contracts.UserInterface
|
||||
{
|
||||
public delegate void ActionRequestedHandler();
|
||||
public delegate void ActionRequestedEventHandler();
|
||||
|
||||
public interface IBrowserWindow : IWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when the user changed the URL.
|
||||
/// </summary>
|
||||
event AddressChangedHandler AddressChanged;
|
||||
event AddressChangedEventHandler AddressChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the user would like to navigate backwards.
|
||||
/// </summary>
|
||||
event ActionRequestedHandler BackwardNavigationRequested;
|
||||
event ActionRequestedEventHandler BackwardNavigationRequested;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the user would like to navigate forwards.
|
||||
/// </summary>
|
||||
event ActionRequestedHandler ForwardNavigationRequested;
|
||||
event ActionRequestedEventHandler ForwardNavigationRequested;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the user would like to reload the current page.
|
||||
/// </summary>
|
||||
event ActionRequestedHandler ReloadRequested;
|
||||
event ActionRequestedEventHandler ReloadRequested;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this window is the main browser window.
|
||||
|
|
|
@ -18,8 +18,7 @@ namespace SafeExamBrowser.Contracts.UserInterface
|
|||
/// <summary>
|
||||
/// Adds the given notification button to the taskbar.
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
void AddNotification(ITaskbarNotification button);
|
||||
void AddNotification(ITaskbarNotification notification);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the absolute height of the taskbar (i.e. in physical pixels).
|
||||
|
|
|
@ -11,18 +11,18 @@ using SafeExamBrowser.Contracts.Configuration;
|
|||
|
||||
namespace SafeExamBrowser.Contracts.UserInterface
|
||||
{
|
||||
public delegate void TaskbarButtonClickHandler(Guid? instanceId = null);
|
||||
public delegate void TaskbarButtonClickedEventHandler(Guid? instanceId = null);
|
||||
|
||||
public interface ITaskbarButton
|
||||
{
|
||||
/// <summary>
|
||||
/// OnClick handler, executed when the user clicks on the application button. If multiple instances of
|
||||
/// an application are active, the handler is only executed when the user selects one of the instances.
|
||||
/// Event fired when the user clicked on the application button. If multiple instances of an application
|
||||
/// are active, the handler is only executed when the user selects one of the instances.
|
||||
/// </summary>
|
||||
event TaskbarButtonClickHandler OnClick;
|
||||
event TaskbarButtonClickedEventHandler Clicked;
|
||||
|
||||
/// <summary>
|
||||
/// Registers a new instance of an application, to be displayed if the user clicks the taskbar button.
|
||||
/// Registers a new instance of an application, to be started / displayed if the user clicked the taskbar button.
|
||||
/// </summary>
|
||||
void RegisterInstance(IApplicationInstance instance);
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
namespace SafeExamBrowser.Contracts.UserInterface
|
||||
{
|
||||
public delegate void TaskbarNotificationClickHandler();
|
||||
public delegate void TaskbarNotificationClickedEventHandler();
|
||||
|
||||
public interface ITaskbarNotification
|
||||
{
|
||||
/// <summary>
|
||||
/// OnClick handler, executed when the user clicks on the notification icon.
|
||||
/// Event fired when the user clicked on the notification icon.
|
||||
/// </summary>
|
||||
event TaskbarNotificationClickHandler OnClick;
|
||||
event TaskbarNotificationClickedEventHandler Clicked;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
namespace SafeExamBrowser.Contracts.UserInterface
|
||||
{
|
||||
public delegate void WindowClosingHandler();
|
||||
public delegate void WindowClosingEventHandler();
|
||||
|
||||
public interface IWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// Event fired when the window is closing.
|
||||
/// </summary>
|
||||
event WindowClosingHandler Closing;
|
||||
event WindowClosingEventHandler Closing;
|
||||
|
||||
/// <summary>
|
||||
/// Brings the window to the foreground.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace SafeExamBrowser.Monitoring.Processes
|
|||
private INativeMethods nativeMethods;
|
||||
private ManagementEventWatcher explorerWatcher;
|
||||
|
||||
public event ExplorerStartedHandler ExplorerStarted;
|
||||
public event ExplorerStartedEventHandler ExplorerStarted;
|
||||
|
||||
public ProcessMonitor(ILogger logger, INativeMethods nativeMethods)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace SafeExamBrowser.Monitoring.Windows
|
|||
private IList<Window> minimizedWindows = new List<Window>();
|
||||
private INativeMethods nativeMethods;
|
||||
|
||||
public event WindowChangedHandler WindowChanged;
|
||||
public event WindowChangedEventHandler WindowChanged;
|
||||
|
||||
public WindowMonitor(ILogger logger, INativeMethods nativeMethods)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace SafeExamBrowser.UserInterface
|
|||
{
|
||||
private bool isMainWindow;
|
||||
private IBrowserSettings settings;
|
||||
public WindowClosingHandler closing;
|
||||
public WindowClosingEventHandler closing;
|
||||
|
||||
public bool IsMainWindow
|
||||
{
|
||||
|
@ -32,12 +32,12 @@ namespace SafeExamBrowser.UserInterface
|
|||
}
|
||||
}
|
||||
|
||||
public event AddressChangedHandler AddressChanged;
|
||||
public event ActionRequestedHandler BackwardNavigationRequested;
|
||||
public event ActionRequestedHandler ForwardNavigationRequested;
|
||||
public event ActionRequestedHandler ReloadRequested;
|
||||
public event AddressChangedEventHandler AddressChanged;
|
||||
public event ActionRequestedEventHandler BackwardNavigationRequested;
|
||||
public event ActionRequestedEventHandler ForwardNavigationRequested;
|
||||
public event ActionRequestedEventHandler ReloadRequested;
|
||||
|
||||
event WindowClosingHandler IWindow.Closing
|
||||
event WindowClosingEventHandler IWindow.Closing
|
||||
{
|
||||
add { closing += value; }
|
||||
remove { closing -= value; }
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace SafeExamBrowser.UserInterface.Controls
|
|||
private IApplicationInfo info;
|
||||
private IList<IApplicationInstance> instances = new List<IApplicationInstance>();
|
||||
|
||||
public event TaskbarButtonClickHandler OnClick;
|
||||
public event TaskbarButtonClickedEventHandler Clicked;
|
||||
|
||||
public ApplicationButton(IApplicationInfo info)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ namespace SafeExamBrowser.UserInterface.Controls
|
|||
{
|
||||
var instanceButton = new ApplicationInstanceButton(instance, info);
|
||||
|
||||
instanceButton.Click += (id) => OnClick?.Invoke(id);
|
||||
instanceButton.Clicked += (id) => Clicked?.Invoke(id);
|
||||
instance.Terminated += (id) => Instance_OnTerminated(id, instanceButton);
|
||||
|
||||
instances.Add(instance);
|
||||
|
@ -81,7 +81,7 @@ namespace SafeExamBrowser.UserInterface.Controls
|
|||
{
|
||||
if (instances.Count <= 1)
|
||||
{
|
||||
OnClick?.Invoke(instances.FirstOrDefault()?.Id);
|
||||
Clicked?.Invoke(instances.FirstOrDefault()?.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -14,14 +14,14 @@ using SafeExamBrowser.UserInterface.Utilities;
|
|||
|
||||
namespace SafeExamBrowser.UserInterface.Controls
|
||||
{
|
||||
internal delegate void InstanceButtonClickedEventHandler(Guid instanceId);
|
||||
|
||||
public partial class ApplicationInstanceButton : UserControl
|
||||
{
|
||||
private IApplicationInfo info;
|
||||
private IApplicationInstance instance;
|
||||
|
||||
public delegate void OnClickHandler(Guid instanceId);
|
||||
|
||||
public event OnClickHandler Click;
|
||||
internal event InstanceButtonClickedEventHandler Clicked;
|
||||
|
||||
public ApplicationInstanceButton(IApplicationInstance instance, IApplicationInfo info)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ namespace SafeExamBrowser.UserInterface.Controls
|
|||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Click?.Invoke(instance.Id);
|
||||
Clicked?.Invoke(instance.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using SafeExamBrowser.Contracts.Configuration;
|
||||
using SafeExamBrowser.Contracts.UserInterface;
|
||||
|
@ -15,7 +16,7 @@ namespace SafeExamBrowser.UserInterface.Controls
|
|||
{
|
||||
public partial class NotificationIcon : UserControl, ITaskbarNotification
|
||||
{
|
||||
public event TaskbarNotificationClickHandler OnClick;
|
||||
public event TaskbarNotificationClickedEventHandler Clicked;
|
||||
|
||||
public NotificationIcon(INotificationInfo info)
|
||||
{
|
||||
|
@ -23,9 +24,9 @@ namespace SafeExamBrowser.UserInterface.Controls
|
|||
InitializeNotificationIcon(info);
|
||||
}
|
||||
|
||||
private void Icon_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||
private void Icon_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OnClick?.Invoke();
|
||||
Clicked?.Invoke();
|
||||
}
|
||||
|
||||
private void InitializeNotificationIcon(INotificationInfo info)
|
||||
|
|
Loading…
Reference in a new issue