-
Notifications
You must be signed in to change notification settings - Fork 0
/
QvSvnLogServer.cs
52 lines (44 loc) · 1.42 KB
/
QvSvnLogServer.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
/*
* Created by SharpDevelop. Licensed under Apache License 2.0, see license.txt for more information.
* User: Miku Laitinen
* Date: 9.11.2012
* Time: 11:29
*/
using System;
using System.Windows.Interop;
using QlikView.Qvx.QvxLibrary;
namespace QvSvnLogConnector
{
/// <summary>
/// Description of QVSvnLogServer.
/// </summary>
internal class QvSvnLogServer : QvxServer
{
public override QvxConnection CreateConnection()
{
return new QvSvnLogConnection();
}
public override string CreateConnectionString()
{
QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "CreateConnectionString()");
Login login = CreateLoginWindowHelper();
login.ShowDialog();
string connectionString = null;
if (login.DialogResult.Equals(true))
{
connectionString = String.Format("Server={0};UserId={1};Password={2}",
login.GetServer(), login.GetUsername(), login.GetPassword());
}
return connectionString;
}
private Login CreateLoginWindowHelper()
{
// Since the owner of the loginWindow is a Win32 process we need to
// use WindowInteropHelper to make it modal to its owner.
Login login = new Login();
WindowInteropHelper wih = new WindowInteropHelper(login);
wih.Owner = MParentWindow;
return login;
}
}
}