-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGeneralViewNode.cs
112 lines (96 loc) · 3.45 KB
/
GeneralViewNode.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
106
107
108
109
110
111
112
/*
* Copyright © 2016 Federation of State Medical Boards
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Linq;
using P3Net.IntegrationServices.Tasks.GenerateSsrs.UI.Converters;
using P3Net.IntegrationServices.UI;
using P3Net.IntegrationServices.UI.Converters;
using P3Net.IntegrationServices.UI.Tasks;
using Microsoft.DataTransformationServices.Controls;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Runtime.Design;
namespace P3Net.IntegrationServices.Tasks.GenerateSsrs.UI
{
/// <summary>Exposes the properties for the General tab.</summary>
[SortProperties(new string[] { "Name", "Description", "HttpConnection", "ReportPath", "ReportFormat" })]
internal class GeneralViewNode : IDtsConnectionServiceProvider
{
#region Construction
public GeneralViewNode ( TaskHost host, IDtsConnectionService connectionService )
{
ConnectionService = connectionService;
//General properties
m_name = host.Name;
m_description = host.Description;
//Connection properties
GenerateSsrsTask task;
if (host.TryGetTask(out task))
{
HttpConnection = task.ServerConnection;
m_format = task.ReportFormat;
m_path = task.ReportPath;
};
}
#endregion
[Browsable(false)]
public IDtsConnectionService ConnectionService { get; private set; }
[Category("General")]
[Description("Specifies the name of the task.")]
public string Name
{
get { return m_name ?? ""; }
set {
if (String.IsNullOrWhiteSpace(value))
throw new ArgumentException("Name cannot be empty.", "value");
m_name = value.Trim();
}
}
[Category("General")]
[Description("Specifies the description of the task.")]
public string Description
{
get { return m_description ?? ""; }
set { m_description = value.Trim(); }
}
[Category("Connection")]
[Description("Specifies the HTTP connection for the reporting server.")]
[TypeConverter(typeof(HttpConnectionsStringConverter))]
public string HttpConnection
{
get { return m_connection ?? ""; }
set { m_connection = value; }
}
[Category("Connection")]
[Description("Specifies the format of the report.")]
[DefaultValue("PDF")]
[TypeConverter(typeof(ReportFormatStringConverter))]
public string ReportFormat
{
get { return m_format ?? ""; }
set { m_format = value; }
}
[Category("Connection")]
[Description("Specifies the path and name of the report.")]
[Editor(typeof(ReportPathEditor), typeof(UITypeEditor))]
public string ReportPath
{
get { return m_path ?? ""; }
set
{
if (value != null)
value = value.EnsureStartsWith("/");
m_path = value;
}
}
#region Private Members
private string m_name, m_description;
private string m_connection;
private string m_format = "PDF", m_path;
#endregion
}
}