Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ISettingsControl.cs « Interface « Library « Duplicati - github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4744b747ce0a966240d7a5ce7d8e76cca7517cbd (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#region Disclaimer / License
// Copyright (C) 2015, The Duplicati Team
// http://www.duplicati.com, info@duplicati.com
// 
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
// 
#endregion
using System;
using System.Collections.Generic;
using System.Text;

namespace Duplicati.Library.Interface
{
    /// <summary>
    /// An interface for modules that register a control in the settings menu.
    /// This control will be placed in a tab page.
    /// The <see cref="GetConfiguration"/> method is invoked for each custom control module when generating a backup.
    /// When editing/creating a backup job, the <see cref="BeginEdit"/> and <see cref="EndEdit"/> functions are invoked.
    /// </summary>
    public interface ISettingsControl : IGUIControl
    {
        /// <summary>
        /// Gets a key that uniquely identifies the control
        /// </summary>
        string Key { get; }

        /// <summary>
        /// Called when the user is editing or creating a backup.
        /// This method can alter the applicationSettings environment and thus communicate with another UI plugin,
        /// such as an <see cref="IBackendGUI"/> or <see cref="IEncryptionGUI"/>.
        /// </summary>
        /// <param name="applicationSettings">The application settings</param>
        /// <param name="guiOptions">The options saved earlier when configuring the control</param>
        void BeginEdit(IDictionary<string, string> applicationSettings, IDictionary<string, string> guiOptions);

        /// <summary>
        /// Called when the user has finished editing or creating a backup.
        /// This method can be used to alter the <see cref="guiOptions"/> collection,
        /// and thus persist a change.
        /// As the other elements can also modify the <see cref="applicationSettings"/> collection,
        /// this can be used to communicate changes from another component.
        /// </summary>
        /// <param name="applicationSettings">The application settings</param>
        /// <param name="guiOptions">The options saved earlier when configuring the control</param>
        void EndEdit(IDictionary<string, string> applicationSettings, IDictionary<string, string> guiOptions);
    }
}