source: extensions/PiwigoLib/PiwigoWpf/Command/PwgCommandEvents.cs @ 31972

Last change on this file since 31972 was 11926, checked in by bayral, 13 years ago

New step for piwigowpf

File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace Com.Piwigo.Wpf.Command
7{
8    public class EventArgs<T> : EventArgs
9    {
10        public EventArgs(T value)
11        {
12            m_value = value;
13        }
14
15        private T m_value;
16
17        public T Value
18        {
19            get { return m_value; }
20        }
21    }
22
23    public class PwgCmdEvents
24    {
25        #region Event for command start/stop running
26        // The delegate the subscribers must implement.
27        public delegate void CmdRunningChangedHandler(
28         AsyncCommand cmd,
29         EventArgs<Boolean>  boolArgs
30        );
31
32        // The event we publish
33        public static event CmdRunningChangedHandler CmdRunningChanged;
34
35        // The method which fires the Event
36        public static void OnCmdRunningChanged(
37           AsyncCommand cmd,
38           EventArgs<Boolean> boolArgs
39        )
40
41        {
42            // Check if there are any Subscribers
43            if (CmdRunningChanged != null)
44            {
45                // Call the Event
46                CmdRunningChanged(cmd, boolArgs);
47            }
48        }
49        #endregion
50
51        #region Event for command send UI info
52        // The delegate the subscribers must implement.
53        public delegate void CmdSendUiInfoHandler(
54         AsyncCommand cmd,
55         EventArgs<String> stringArgs
56        );
57
58        // The event we publish
59        public static event CmdSendUiInfoHandler CmdSendUiInfo;
60
61        // The method which fires the Event
62        public static void OnCmdSendUiInfo(
63           AsyncCommand cmd,
64           EventArgs<String> stringArgs
65        )
66        {
67            // Check if there are any Subscribers
68            if (CmdSendUiInfo != null)
69            {
70                // Call the Event
71                CmdSendUiInfo(cmd, stringArgs);
72            }
73        }
74        #endregion
75    }
76}
Note: See TracBrowser for help on using the repository browser.