1 /*
2   KeePass Password Safe - The Open-Source Password Manager
3   Copyright (C) 2003-2021 Dominik Reichl <dominik.reichl@t-online.de>
4 
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU General Public License as published by
7   the Free Software Foundation; either version 2 of the License, or
8   (at your option) any later version.
9 
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14 
15   You should have received a copy of the GNU General Public License
16   along with this program; if not, write to the Free Software
17   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19 
20 using System;
21 
22 namespace KeePassLib.Delegates
23 {
24 	/// <summary>
25 	/// Function definition of a method that performs an action on a group.
26 	/// When traversing the internal tree, this function will be invoked
27 	/// for all visited groups.
28 	/// </summary>
29 	/// <param name="pg">Currently visited group.</param>
30 	/// <returns>You must return <c>true</c> if you want to continue the
31 	/// traversal. If you want to immediately stop the whole traversal,
32 	/// return <c>false</c>.</returns>
GroupHandler(PwGroup pg)33 	public delegate bool GroupHandler(PwGroup pg);
34 
35 	/// <summary>
36 	/// Function definition of a method that performs an action on an entry.
37 	/// When traversing the internal tree, this function will be invoked
38 	/// for all visited entries.
39 	/// </summary>
40 	/// <param name="pe">Currently visited entry.</param>
41 	/// <returns>You must return <c>true</c> if you want to continue the
42 	/// traversal. If you want to immediately stop the whole traversal,
43 	/// return <c>false</c>.</returns>
EntryHandler(PwEntry pe)44 	public delegate bool EntryHandler(PwEntry pe);
45 
VoidDelegate()46 	public delegate void VoidDelegate();
StrPwEntryDelegate(string str, PwEntry pe)47 	public delegate string StrPwEntryDelegate(string str, PwEntry pe);
48 
49 	// Action<...> with 0 or >= 2 parameters has been introduced in .NET 3.5
GAction()50 	public delegate void GAction();
GAction(T o)51 	public delegate void GAction<T>(T o);
GAction(T1 o1, T2 o2)52 	public delegate void GAction<T1, T2>(T1 o1, T2 o2);
GAction(T1 o1, T2 o2, T3 o3)53 	public delegate void GAction<T1, T2, T3>(T1 o1, T2 o2, T3 o3);
GAction(T1 o1, T2 o2, T3 o3, T4 o4)54 	public delegate void GAction<T1, T2, T3, T4>(T1 o1, T2 o2, T3 o3, T4 o4);
GAction(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5)55 	public delegate void GAction<T1, T2, T3, T4, T5>(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5);
GAction(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5, T6 o6)56 	public delegate void GAction<T1, T2, T3, T4, T5, T6>(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5, T6 o6);
57 
58 	// Func<...> has been introduced in .NET 3.5
GFunc()59 	public delegate TResult GFunc<TResult>();
GFunc(T o)60 	public delegate TResult GFunc<T, TResult>(T o);
GFunc(T1 o1, T2 o2)61 	public delegate TResult GFunc<T1, T2, TResult>(T1 o1, T2 o2);
GFunc(T1 o1, T2 o2, T3 o3)62 	public delegate TResult GFunc<T1, T2, T3, TResult>(T1 o1, T2 o2, T3 o3);
GFunc(T1 o1, T2 o2, T3 o3, T4 o4)63 	public delegate TResult GFunc<T1, T2, T3, T4, TResult>(T1 o1, T2 o2, T3 o3, T4 o4);
GFunc(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5)64 	public delegate TResult GFunc<T1, T2, T3, T4, T5, TResult>(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5);
GFunc(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5, T6 o6)65 	public delegate TResult GFunc<T1, T2, T3, T4, T5, T6, TResult>(T1 o1, T2 o2, T3 o3, T4 o4, T5 o5, T6 o6);
66 }
67