-
Notifications
You must be signed in to change notification settings - Fork 107
/
SccProviderOptions.cs
105 lines (94 loc) · 4.08 KB
/
SccProviderOptions.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/***************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
This code is licensed under the Visual Studio SDK license terms.
THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
***************************************************************************/
using System;
using System.ComponentModel;
using System.Collections;
using System.Drawing;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using MsVsShell = Microsoft.VisualStudio.Shell;
namespace GitScc
{
/// <summary>
/// Summary description for SccProviderOptions.
/// </summary>
///
[Guid("C4128D99-111E-4a5b-9834-076CB319ED59")]
public class SccProviderOptions : MsVsShell.DialogPage
{
private SccProviderOptionsControl page = null;
/// <include file='doc\DialogPage.uex' path='docs/doc[@for="DialogPage".Window]' />
/// <devdoc>
/// The window this dialog page will use for its UI.
/// This window handle must be constant, so if you are
/// returning a Windows Forms control you must make sure
/// it does not recreate its handle. If the window object
/// implements IComponent it will be sited by the
/// dialog page so it can get access to global services.
/// </devdoc>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
protected override IWin32Window Window
{
get
{
page = new SccProviderOptionsControl();
page.Location = new Point(0, 0);
page.OptionsPage = this;
return page;
}
}
/// <include file='doc\DialogPage.uex' path='docs/doc[@for="DialogPage.OnActivate"]' />
/// <devdoc>
/// This method is called when VS wants to activate this
/// page. If the Cancel property of the event is set to true, the page is not activated.
/// </devdoc>
protected override void OnActivate(CancelEventArgs e)
{
Trace.WriteLine(string.Format("In OnActivate"));
base.OnActivate(e);
}
/// <include file='doc\DialogPage.uex' path='docs/doc[@for="DialogPage.OnClosed"]' />
/// <devdoc>
/// This event is raised when the page is closed.
/// </devdoc>
protected override void OnClosed(EventArgs e)
{
Trace.WriteLine(string.Format("In OnClosed"));
base.OnClosed(e);
}
/// <include file='doc\DialogPage.uex' path='docs/doc[@for="DialogPage.OnDeactivate"]' />
/// <devdoc>
/// This method is called when VS wants to deatviate this
/// page. If true is set for the Cancel property of the event,
/// the page is not deactivated.
/// </devdoc>
protected override void OnDeactivate(CancelEventArgs e)
{
Trace.WriteLine(string.Format("In OnDeactivate"));
base.OnDeactivate(e);
}
/// <include file='doc\DialogPage.uex' path='docs/doc[@for="DialogPage.OnApply"]' />
/// <devdoc>
/// This method is called when VS wants to save the user's
/// changes then the dialog is dismissed.
/// </devdoc>
protected override void OnApply(PageApplyEventArgs e)
{
Trace.WriteLine(string.Format("In OnApply"));
// Preventing the dialog to close if the options were not filled in completely can be done
// by setting the ApplyBehavior if needed (e.ApplyBehavior = ApplyKind.Cancel;)
base.OnApply(e);
if (page != null) page.Save();
}
}
}