-
Notifications
You must be signed in to change notification settings - Fork 2
/
HtmlTextInfo.cs
107 lines (94 loc) · 3.87 KB
/
HtmlTextInfo.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
// <copyright file="HtmlTextInfo.cs" company="Engage Software">
// Engage: F3
// Copyright (c) 2004-2013
// by Engage Software ( http://www.engagesoftware.com )
// </copyright>
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
namespace Engage.Dnn.F3
{
using System;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Framework;
/// <summary>
/// Implements <see cref="IHtmlTextInfo"/> by wrapping a <see cref="DotNetNuke.Modules.Html.HtmlTextInfo"/> instance created via reflection
/// </summary>
/// <remarks>Need to use reflection because type could be in <c>DotNetNuke.Modules.Html</c> assembly or in <c>DotNetNuke.Professional.HtmlPro</c> assembly.</remarks>
public class HtmlTextInfo : IHtmlTextInfo
{
/// <summary>
/// The type of the <c>HtmlTextInfo</c> that the module is using (CE or PE)
/// </summary>
private static readonly Type HtmlTextInfoType =
Reflection.CreateType("DotNetNuke.Modules.HtmlPro.HtmlTextInfo")
?? Reflection.CreateType("DotNetNuke.Modules.Html.HtmlTextInfo");
/// <summary>
/// Initializes a new instance of the <see cref="HtmlTextInfo"/> class.
/// </summary>
public HtmlTextInfo()
{
this.HtmlTextInfoInstance = Reflection.CreateInstance(HtmlTextInfoType);
Reflection.SetProperty(HtmlTextInfoType, "ItemID", this.HtmlTextInfoInstance, new object[] { Null.NullInteger });
}
public HtmlTextInfo(object htmlTextInfoInstance)
{
this.HtmlTextInfoInstance = htmlTextInfoInstance;
}
public int ModuleId
{
get
{
return (int)Reflection.GetProperty(HtmlTextInfoType, "ModuleID", this.HtmlTextInfoInstance);
}
set
{
Reflection.SetProperty(HtmlTextInfoType, "ModuleID", this.HtmlTextInfoInstance, new object[] { value });
}
}
public string Content
{
get
{
return (string)Reflection.GetProperty(HtmlTextInfoType, "Content", this.HtmlTextInfoInstance);
}
set
{
Reflection.SetProperty(HtmlTextInfoType, "Content", this.HtmlTextInfoInstance, new object[] { value });
}
}
public int WorkflowId
{
get
{
return (int)Reflection.GetProperty(HtmlTextInfoType, "WorkflowID", this.HtmlTextInfoInstance);
}
set
{
Reflection.SetProperty(HtmlTextInfoType, "WorkflowID", this.HtmlTextInfoInstance, new object[] { value });
}
}
public int StateId
{
get
{
return (int)Reflection.GetProperty(HtmlTextInfoType, "StateID", this.HtmlTextInfoInstance);
}
set
{
Reflection.SetProperty(HtmlTextInfoType, "StateID", this.HtmlTextInfoInstance, new object[] { value });
}
}
/// <summary>
/// Gets the actual <see cref="DotNetNuke.Modules.Html.HtmlTextInfo"/> instance.
/// </summary>
/// <value>An <see cref="DotNetNuke.Modules.Html.HtmlTextInfo"/> instance.</value>
public object HtmlTextInfoInstance
{
get;
private set;
}
}
}