This repository has been archived by the owner on May 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Page.cs
172 lines (160 loc) · 4.52 KB
/
Page.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//This is a source code or part of Huggle project
//
//This file contains code for
/// <DOCUMENTATION>
/// There is no documentation for this
/// </DOCUMENTATION>
//Copyright (C) 2011-2012 Huggle team
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//This program 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 General Public License for more details.
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace huggle3
{
/// <summary>
/// Page
/// </summary>
public class Page
{
public class SpeedyCriterion
{
public string Code;
public string DisplayCode;
public string Description;
public string Template;
public string Parameter;
}
/// <summary>
/// Name of the article
/// </summary>
public string Name;
/// <summary>
/// WP-Space
/// </summary>
public Space _Space = new Space();
/// <summary>
/// Does the page exist
/// </summary>
public bool Exists;
/// <summary>
/// List of all pages which are cached
/// </summary>
private Dictionary<string, Page> Shared_All = new Dictionary<string,Page>();
/// <summary>
/// First Edit
/// </summary>
public Edit FirstEdit;
/// <summary>
/// Current edit
/// </summary>
public Edit LastEdit;
/// <summary>
/// Level
/// </summary>
public PageLevel level;
/// <summary>
/// Deletes (history)
/// </summary>
public static List<string> deletes;
/// <summary>
/// Current deletes (deleted)
/// </summary>
public bool DeletesCurrent;
/// <summary>
/// Protections
/// </summary>
public List<Core.Protection> protection;
/// <summary>
/// Current protection
/// </summary>
public bool ProtectionsCurrent;
/// <summary>
/// meh
/// </summary>
public string HistoryOffset;
/// <summary>
/// Has the page been patrolled
/// </summary>
public bool patrolled;
/// <summary>
/// RcId
/// </summary>
public string Rcid;
/// <summary>
/// comment
/// </summary>
public SpeedyCriterion SpeedyCrit;
/// <summary>
/// Page text content
/// </summary>
public string Text;
/// <summary>
/// Level
/// </summary>
public string EditLevel;
/// <summary>
/// Pending revision
/// </summary>
public bool Pending;
/// <summary>
/// Level
/// </summary>
public string MoveLevel;
/// <summary>
/// Gets a value indicating whether this instance is subpage.
/// </summary>
/// <value><c>true</c> if this instance is subpage; otherwise, <c>false</c>.</value>
public bool IsSubpage
{
get {
if (this.Name.Contains("/"))
{
return true;
}
return false;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="huggle3.Page"/> class.
/// </summary>
/// <param name="Name">Name.</param>
public Page(string Name )
{
this.Name = Name;
_Space = Space.DetectSpace(Name);
Shared_All.Add(Name, this);
}
/// <summary>
/// Initializes a new instance of the <see cref="huggle3.Page"/> class.
/// </summary>
public Page()
{
// special contructor, obsolete
this.Name = "Special:Unknown";
_Space = Space.DetectSpace(Name);
Shared_All.Add(Name, this);
}
public enum PageLevel
{
None = 0,
Ignore = -1,
Watch = 1,
Bad = 2
}
public enum ProtectionType
{
None,
Confirmed,
Sysop,
PC
}
}
}