C# Class WikiFunctions.Variables

Holds static variables, to allow functionality on different wikis.
Afficher le fichier Open project: reedy/AutoWikiBrowser

Méthodes publiques

Свойство Type Description
CanonicalNamespaceAliases List>.Dictionary
CanonicalNamespaces string>.Dictionary
ENLangMonthNames string[]
MagicWords List>.Dictionary
MonthNames string[]
NamespaceAliases List>.Dictionary
Namespaces string>.Dictionary
NamespacesCaseInsensitive string>.Dictionary
Profiler Profiler
ReloadProjectSettings ProjectHoldArea
RetfPath string
SectStub string
SectStubRegex System.Text.RegularExpressions.Regex
Stub string
URL string
UnderscoredTitles List

Méthodes publiques

Méthode Description
AWBVersionString ( string version ) : string
AddUnderscoredTitles ( List titles ) : void

For unit tests only, method to add entries to UnderscoredTitles

GetArticleHistoryURL ( string title ) : string

returns full URL to the history page of the input title, depends on project settings

GetEditURL ( string title ) : string

returns full URL to the edit page of the input title, depends on project settings

GetPlainTextURL ( string title ) : string

Returns the full URL to the input wiki page using current site settings, specifying &action=raw

GetUserTalkURL ( string username ) : string

returns full URL to the user talk page of the input user, depends on project settings

NonPrettifiedURL ( string title ) : string

returns full URL to the given page, depends on project settings

PrepareWebRequest ( string url ) : HttpWebRequest

Creates an HTTP web request. Timeout set to 15 seconds

PrepareWebRequest ( string url, string userAgent ) : HttpWebRequest

Creates an HTTP web request. Timeout set to 15 seconds

RefreshProxy ( ) : void

Refreshs the system proxy.

SetProject ( string langCode, ProjectEnum projectName ) : void

Sets different language variables, such as namespaces. Default is english Wikipedia

SetProject ( string langCode, ProjectEnum projectName, string customProject, string protocol ) : void

Sets different language variables, such as namespaces. Default is english Wikipedia

SetProjectLangCode ( string langCode ) : void

Sets the language code of the current project

Do not use this outside unit tests

SetProjectSimple ( string langCode, ProjectEnum projectName ) : void

Sets different language variables, such as namespaces. Default is English Wikipedia

Do not use this outside unit tests

WaitForDelayedRequests ( ) : void

Waits for all background stuff to be loaded

Private Methods

Méthode Description
AWBDefaultSummaryTag ( ) : void

Sets the AWB default summary tag.

CancelBackgroundRequests ( ) : void
LoadUnderscores ( ) : void
PrepareAliases ( string>.Dictionary namespaces ) : List>.Dictionary
RegenerateRegexes ( ) : void

SetLanguageSpecificValues ( string langCode, ProjectEnum projectName ) : void

Sets the language specific values: summary tag, stub regex, AWB project link

SetToEnglish ( ) : void

UnderscoresLoaded ( WikiFunctions.Background.BackgroundRequest req ) : void
Variables ( ) : System

Method Details

AWBVersionString() public static méthode

public static AWBVersionString ( string version ) : string
version string
Résultat string

AddUnderscoredTitles() public static méthode

For unit tests only, method to add entries to UnderscoredTitles
public static AddUnderscoredTitles ( List titles ) : void
titles List
Résultat void

GetArticleHistoryURL() public static méthode

returns full URL to the history page of the input title, depends on project settings
public static GetArticleHistoryURL ( string title ) : string
title string
Résultat string

GetEditURL() public static méthode

returns full URL to the edit page of the input title, depends on project settings
public static GetEditURL ( string title ) : string
title string
Résultat string

GetPlainTextURL() public static méthode

Returns the full URL to the input wiki page using current site settings, specifying &action=raw
public static GetPlainTextURL ( string title ) : string
title string
Résultat string

GetUserTalkURL() public static méthode

returns full URL to the user talk page of the input user, depends on project settings
public static GetUserTalkURL ( string username ) : string
username string
Résultat string

NonPrettifiedURL() public static méthode

returns full URL to the given page, depends on project settings
public static NonPrettifiedURL ( string title ) : string
title string
Résultat string

PrepareWebRequest() public static méthode

Creates an HTTP web request. Timeout set to 15 seconds
public static PrepareWebRequest ( string url ) : HttpWebRequest
url string /// URL. ///
Résultat System.Net.HttpWebRequest

PrepareWebRequest() public static méthode

Creates an HTTP web request. Timeout set to 15 seconds
public static PrepareWebRequest ( string url, string userAgent ) : HttpWebRequest
url string
userAgent string
Résultat System.Net.HttpWebRequest

RefreshProxy() public static méthode

Refreshs the system proxy.
public static RefreshProxy ( ) : void
Résultat void

SetProject() public static méthode

Sets different language variables, such as namespaces. Default is english Wikipedia
public static SetProject ( string langCode, ProjectEnum projectName ) : void
langCode string The language code, default is en
projectName ProjectEnum The project name default is Wikipedia
Résultat void

SetProject() public static méthode

Sets different language variables, such as namespaces. Default is english Wikipedia
public static SetProject ( string langCode, ProjectEnum projectName, string customProject, string protocol ) : void
langCode string The language code, default is en
projectName ProjectEnum The project name default is Wikipedia
customProject string Script path of a custom project or ""
protocol string
Résultat void

SetProjectLangCode() public static méthode

Sets the language code of the current project
Do not use this outside unit tests
public static SetProjectLangCode ( string langCode ) : void
langCode string The new language code to use
Résultat void

SetProjectSimple() public static méthode

Sets different language variables, such as namespaces. Default is English Wikipedia
Do not use this outside unit tests
public static SetProjectSimple ( string langCode, ProjectEnum projectName ) : void
langCode string The language code, default is en
projectName ProjectEnum The project name default is Wikipedia
Résultat void

WaitForDelayedRequests() public static méthode

Waits for all background stuff to be loaded
public static WaitForDelayedRequests ( ) : void
Résultat void

Property Details

CanonicalNamespaceAliases public_oe static_oe property

Canonical namespace aliases
public static Dictionary> CanonicalNamespaceAliases
Résultat List>.Dictionary

CanonicalNamespaces public_oe static_oe property

Provides access to the en namespace keys e.g. Category:
public static Dictionary CanonicalNamespaces
Résultat string>.Dictionary

ENLangMonthNames public_oe static_oe property

public static string[] ENLangMonthNames
Résultat string[]

MagicWords public_oe static_oe property

public static Dictionary> MagicWords
Résultat List>.Dictionary

MonthNames public_oe static_oe property

localized names of months
public static string[] MonthNames
Résultat string[]

NamespaceAliases public_oe static_oe property

Aliases for current namespaces
public static Dictionary> NamespaceAliases
Résultat List>.Dictionary

Namespaces public_oe static_oe property

Provides access to the namespace keys e.g. Category:
public static Dictionary Namespaces
Résultat string>.Dictionary

NamespacesCaseInsensitive public_oe static_oe property

Provides access to the namespace keys in a form so the first letter is case insensitive e.g. [Ww]ikipedia:
public static Dictionary NamespacesCaseInsensitive
Résultat string>.Dictionary

Profiler public_oe static_oe property

Performance profiler
public static Profiler,WikiFunctions Profiler
Résultat Profiler

ReloadProjectSettings public_oe static_oe property

public static ProjectHoldArea ReloadProjectSettings
Résultat ProjectHoldArea

RetfPath public_oe static_oe property

Page of RegexTypoFix rules page e.g. Project:AutoWikiBrowser/Typos. Can be full URL if specified as such on <!--Typos--> check page comment
public static string RetfPath
Résultat string

SectStub public_oe static_oe property

public static string SectStub
Résultat string

SectStubRegex public_oe static_oe property

public static Regex,System.Text.RegularExpressions SectStubRegex
Résultat System.Text.RegularExpressions.Regex

Stub public_oe static_oe property

public static string Stub
Résultat string

URL public_oe static_oe property

Gets a URL of the site, e.g. "https://en.wikipedia.org".
public static string URL
Résultat string

UnderscoredTitles public_oe static_oe property

Contains list of pages with underscores in titles, from [[Category:Articles with underscores in the title]] for en wiki
public static List UnderscoredTitles
Résultat List