-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionSource.cs
44 lines (38 loc) · 1.73 KB
/
ActionSource.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/******************************************************************************
* *
* PROJECT : Eos Digital camera Software Development Kit EDSDK *
* *
* Description: This is the Sample code to show the usage of EDSDK. *
* *
* *
*******************************************************************************
* *
* Written and developed by Canon Inc. *
* Copyright Canon Inc. 2018 All Rights Reserved *
* *
*******************************************************************************/
using System;
using System.Collections.Generic;
namespace CameraControl
{
public class ActionSource
{
List<ActionListener> listeners = new List<ActionListener>();
public void AddActionListener(ref ActionListener listener)
{
listeners.Add(listener);
}
public void RemoveActionListener(ref ActionListener listener)
{
listeners.Remove(listener);
}
public void FireEvent(ActionEvent.Command command, IntPtr arg)
{
ActionEvent e = new ActionEvent(command, arg);
for (var i = 0; i < listeners.Count; i++)
{
listeners[i].ActionPerformed(e);
}
}
}
}