本文整理汇总了C#中ProjectEnum类的典型用法代码示例。如果您正苦于以下问题:C# ProjectEnum类的具体用法?C# ProjectEnum怎么用?C# ProjectEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectEnum类属于命名空间,在下文中一共展示了ProjectEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyPreferences
/// <summary>
///
/// </summary>
/// <param name="lang"></param>
/// <param name="proj"></param>
/// <param name="customproj"></param>
/// <param name="protocol"></param>
public MyPreferences(string lang, ProjectEnum proj, string customproj, string protocol)
{
InitializeComponent();
foreach (ProjectEnum l in Enum.GetValues(typeof(ProjectEnum)))
{
cmboProject.Items.Add(l);
}
cmboProject.SelectedItem = proj;
cmboProject_SelectedIndexChanged(null, null);
cmboLang.SelectedItem = lang.ToLower();
cmboCustomProject.Items.Clear();
foreach (string s in Properties.Settings.Default.CustomWikis.Split('|').Where(s => !cmboCustomProject.Items.Contains(s)))
{
cmboCustomProject.Items.Add(s);
}
cmboCustomProject.Text = customproj;
chkSupressAWB.Enabled = (cmboProject.Text == "custom" || cmboProject.Text == "wikia");
chkAlwaysConfirmExit.Checked = Properties.Settings.Default.AskForTerminate;
chkPrivacy.Checked = !Properties.Settings.Default.Privacy;
if (Globals.UsingMono)
{
chkFlash.Enabled = false;
chkFlash.Checked = false;
}
cmboProtocol.SelectedIndex = (protocol == "http://") ? 0 : 1;
}
示例2: MyPreferences
public MyPreferences(LangCodeEnum lang, ProjectEnum proj, string customproj,
Font textFont, bool lowPriority, bool flash, bool beep, bool minimize,
bool saveArticleList, decimal timeOut, bool autoSaveEditBox,
string autoSaveEditBoxFile, decimal autoSaveEditBoxPeriod, bool suppressUsingAWB,
bool addUsingAWBOnArticleAction, bool ignoreNoBots, bool falsePositives,
bool showTimer)
{
InitializeComponent();
foreach (LangCodeEnum l in Enum.GetValues(typeof(LangCodeEnum)))
cmboLang.Items.Add(l.ToString().ToLower());
foreach (ProjectEnum l in Enum.GetValues(typeof(ProjectEnum)))
cmboProject.Items.Add(l);
cmboLang.SelectedItem = lang.ToString().ToLower();
cmboProject.SelectedItem = proj;
cmboCustomProject.Items.Clear();
foreach (string s in Properties.Settings.Default.CustomWikis.Split('|'))
{
if (!cmboCustomProject.Items.Contains(s))
cmboCustomProject.Items.Add(s);
}
cmboCustomProject.Text = customproj;
TextBoxFont = textFont;
LowThreadPriority = lowPriority;
PrefFlash = flash;
PrefBeep = beep;
PrefMinimize = minimize;
PrefSaveArticleList = saveArticleList;
PrefTimeOutLimit = timeOut;
PrefAutoSaveEditBoxEnabled = autoSaveEditBox;
PrefAutoSaveEditBoxFile = autoSaveEditBoxFile;
PrefAutoSaveEditBoxPeriod = autoSaveEditBoxPeriod;
PrefIgnoreNoBots = ignoreNoBots;
PrefFalsePositives = falsePositives;
PrefShowTimer = showTimer;
PrefAddUsingAWBOnArticleAction = addUsingAWBOnArticleAction;
chkSupressAWB.Enabled = (cmboProject.Text == "custom" || cmboProject.Text == "wikia");
if (chkSupressAWB.Enabled)
PrefSuppressUsingAWB = suppressUsingAWB;
else
PrefSuppressUsingAWB = false;
cmboProject_SelectedIndexChanged(null, null);
chkAlwaysConfirmExit.Checked = Properties.Settings.Default.AskForTerminate;
chkPrivacy.Checked = !Properties.Settings.Default.Privacy;
}
示例3: SetProject
private void SetProject(LangCodeEnum code, ProjectEnum project, string customProject)
{
SplashScreen.SetProgress(81);
try
{
//set namespaces
Variables.SetProject(code, project, customProject);
//set interwikiorder
switch (Variables.LangCode)
{
case LangCodeEnum.en:
case LangCodeEnum.pl:
case LangCodeEnum.simple:
Parser.InterWikiOrder = InterWikiOrderEnum.LocalLanguageAlpha;
break;
case LangCodeEnum.he:
case LangCodeEnum.hu:
Parser.InterWikiOrder = InterWikiOrderEnum.AlphabeticalEnFirst;
break;
default:
Parser.InterWikiOrder = InterWikiOrderEnum.Alphabetical;
break;
}
//user interface
if (!Variables.IsWikipediaEN)
{
humanNameDisambigTagToolStripMenuItem.Visible = birthdeathCatsToolStripMenuItem.Visible = false;
chkAutoTagger.Checked = false;
}
else if (!humanNameDisambigTagToolStripMenuItem.Visible)
{
humanNameDisambigTagToolStripMenuItem.Visible = birthdeathCatsToolStripMenuItem.Visible = true;
}
UserTalkWarningsLoaded = false; // force reload
if (!Variables.IsCustomProject && !Variables.IsWikia && !Variables.IsWikimediaMonolingualProject)
lblProject.Text = Variables.LangCodeEnumString() + "." + Variables.Project;
else lblProject.Text = Variables.IsWikimediaMonolingualProject ? Variables.Project.ToString() : Variables.URL;
ResetTypoStats();
}
catch (ArgumentNullException)
{
MessageBox.Show("The interwiki list didn't load correctly. Please check your internet connection, and then restart AWB");
}
}
示例4: IsWikimediaProject
// Covered by ToolsTests.IsWikimediaProject()
/// <summary>
/// Returns true if given project belongs to Wikimedia
/// </summary>
public static bool IsWikimediaProject(ProjectEnum p)
{
return (p != ProjectEnum.custom && p != ProjectEnum.wikia);
}
示例5: IsWikimediaProject
/// <summary>
/// Returns true if given project belongs to Wikimedia
/// </summary>
public static bool IsWikimediaProject(ProjectEnum p)
{
return (p == ProjectEnum.commons || p == ProjectEnum.meta || p == ProjectEnum.species
|| p == ProjectEnum.wikibooks || p == ProjectEnum.wikinews || p == ProjectEnum.wikipedia
|| p == ProjectEnum.wikiquote || p == ProjectEnum.wikisource || p == ProjectEnum.wikiversity
|| p == ProjectEnum.wiktionary);
}
示例6: SetProject
/// <summary>
/// Sets different language variables, such as namespaces. Default is english Wikipedia
/// </summary>
/// <param name="langCode">The language code, default is en</param>
/// <param name="projectName">The project name default is Wikipedia</param>
/// <param name="customProject">Script path of a custom project or ""</param>
/// <param name="usingSecure"></param>
public static void SetProject(string langCode, ProjectEnum projectName, string customProject, bool usingSecure)
{
TryLoadingAgainAfterLogin = false;
Namespaces.Clear();
CancelBackgroundRequests();
UnderscoredTitles.Clear();
WikiRegexes.TemplateRedirects.Clear();
Project = projectName;
LangCode = langCode;
CustomProject = customProject;
UsingSecure = usingSecure;
RefreshProxy();
URLEnd = "/w/";
AWBDefaultSummaryTag();
Stub = "[^{}|]*?[Ss]tub";
MonthNames = ENLangMonthNames;
SectStub = @"\{\{[Ss]ect";
SectStubRegex = new Regex(SectStub, RegexOptions.Compiled);
if (IsCustomProject)
{
LangCode = "en";
int x = customProject.IndexOf('/');
if (x > 0)
{
URLEnd = customProject.Substring(x, customProject.Length - x);
CustomProject = customProject.Substring(0, x);
}
URL = "http://" + CustomProject;
}
else
{
URL = "http://" + LangCode + "." + Project + ".org";
URLSecure = "https://secure.wikimedia.org/";
if (IsWikimediaMonolingualProject)
{
URLSecure += "wikipedia/" + Project;
}
else
{
URLSecure += Project + "/" + LangCode; //https://secure.wikimedia.org/wikipedia/en
}
}
// HACK:
switch (projectName)
{
case ProjectEnum.wikipedia:
case ProjectEnum.wikinews:
case ProjectEnum.wikisource:
case ProjectEnum.wikibooks:
case ProjectEnum.wikiquote:
case ProjectEnum.wiktionary:
case ProjectEnum.wikiversity:
switch (langCode)
{
case "en":
if (projectName == ProjectEnum.wikipedia)
SetToEnglish();
break;
case "ar":
mSummaryTag = " ";
WPAWB = "باستخدام [[ويكيبيديا:أوب|الأوتوويكي براوزر]]";
TypoSummaryTag = ".الأخطاء المصححة: ";
break;
case "bg":
mSummaryTag = " редактирано с ";
WPAWB = "AWB";
break;
case "ca":
mSummaryTag = " ";
WPAWB = "[[Viquipèdia:AutoWikiBrowser|AWB]]";
break;
case "da":
mSummaryTag = " ved brug af ";
WPAWB = "[[en:Wikipedia:AutoWikiBrowser|AWB]]";
break;
case "de":
mSummaryTag = " mit ";
TypoSummaryTag = ", Schreibweise:";
//.........这里部分代码省略.........
示例7: SetProject
/// <summary>
/// Sets different language variables, such as namespaces. Default is english Wikipedia
/// </summary>
/// <param name="langCode">The language code, default is en</param>
/// <param name="projectName">The project name default is Wikipedia</param>
/// <param name="customProject">Script path of a custom project or ""</param>
public static void SetProject(LangCodeEnum langCode, ProjectEnum projectName, string customProject)
{
Namespaces.Clear();
CancelBackgroundRequests();
UnderscoredTitles.Clear();
if (customProject.Contains("traditio.") || customProject.Contains("volgota.com")
|| customProject.Contains("encyclopediadramatica"))
{
MessageBox.Show("This software does not work on attack sites.");
Application.Exit();
}
Project = projectName;
LangCode = langCode;
CustomProject = customProject;
RefreshProxy();
URLEnd = "/w/";
AWBDefaultSummaryTag();
Stub = "[Ss]tub";
MonthNames = ENLangMonthNames;
SectStub = @"\{\{[Ss]ect";
if (IsCustomProject)
{
LangCode = LangCodeEnum.en;
int x = customProject.IndexOf('/');
if (x > 0)
{
URLEnd = customProject.Substring(x, customProject.Length - x);
customProject = customProject.Substring(0, x);
}
URL = "http://" + CustomProject;
}
else
URL = "http://" + LangCodeEnumString() + "." + Project + ".org";
switch (projectName)
{
case ProjectEnum.wikipedia:
case ProjectEnum.wikinews:
case ProjectEnum.wikisource:
case ProjectEnum.wikibooks:
case ProjectEnum.wikiquote:
case ProjectEnum.wiktionary:
case ProjectEnum.wikiversity:
switch (langCode)
{
case LangCodeEnum.en:
SetToEnglish();
break;
case LangCodeEnum.ar:
mSummaryTag = " ";
strWPAWB = "باستخدام [[ويكيبيديا:أوب|الأوتوويكي براوزر]]";
strTypoSummaryTag = ".الأخطاء المصححة: ";
break;
case LangCodeEnum.bg:
mSummaryTag = " редактирано с ";
strWPAWB = "AWB";
break;
case LangCodeEnum.ca:
mSummaryTag = " ";
strWPAWB = "[[Viquipèdia:AutoWikiBrowser|AWB]]";
break;
case LangCodeEnum.da:
mSummaryTag = " ved brug af ";
strWPAWB = "[[en:Wikipedia:AutoWikiBrowser|AWB]]";
break;
case LangCodeEnum.de:
mSummaryTag = " mit ";
strTypoSummaryTag = ", Schreibweise:";
break;
case LangCodeEnum.eo:
mSummaryTag = " ";
strWPAWB = "[[Vikipedio:AutoWikiBrowser|AWB]]";
break;
case LangCodeEnum.hu:
mSummaryTag = " ";
strWPAWB = "[[Wikipédia:AutoWikiBrowser|AWB]]";
break;
//.........这里部分代码省略.........
示例8: SetProject
/// <summary>
/// Sets different language variables, such as namespaces. Default is english Wikipedia
/// </summary>
/// <param name="langCode">The language code, default is en</param>
/// <param name="projectName">The project name default is Wikipedia</param>
public static void SetProject(string langCode, ProjectEnum projectName)
{
SetProject(langCode, projectName, "", "http://");
}
示例9: SetLanguageSpecificValues
/// <summary>
/// Sets the language specific values: summary tag, stub regex, AWB project link
/// </summary>
/// <param name='langCode'>
/// Language code of wiki.
/// </param>
/// <param name='projectName'>
/// Project name of wiki.
/// </param>
private static void SetLanguageSpecificValues(string langCode, ProjectEnum projectName)
{
switch (langCode)
{
case "en":
if (projectName == ProjectEnum.wikipedia)
SetToEnglish();
TypoSummaryTag = @"[[WP:AWB/T|typo(s) fixed]]: ";
break;
case "ar":
mSummaryTag = "";
WPAWB = "باستخدام [[Project:أوب|أوب]]";
Stub = @"[^{}|]*?(?:[Ss]tub|بذرة|بذور)[^{}]*?";
TypoSummaryTag = "الأخطاء المصححة: ";
break;
case "arz":
mSummaryTag = "";
WPAWB = "عن طريق [[Project:AWB|اوب]]";
Stub = @"[^{}|]*?(?:[Ss]tub|تقاوى|بذرة)[^{}]*?";
TypoSummaryTag = "الأخطاء المصححة: ";
break;
case "bg":
mSummaryTag = "редактирано с";
WPAWB = "AWB";
break;
case "ca":
mSummaryTag = "";
WPAWB = "[[Viquipèdia:AutoWikiBrowser|AWB]]";
break;
case "cs":
mSummaryTag = "za použití";
WPAWB = "[[Wikipedie:AutoWikiBrowser|AWB]]";
Stub = @"[^{}|]*?([Pp]ahýl)";
break;
case "cy":
Stub = @"[^{}|]*?([Ss]tub|[Εe]ginyn[^{}]*?)";
break;
case "da":
mSummaryTag = "ved brug af";
WPAWB = "[[en:WP:AWB|AWB]]";
break;
case "de":
mSummaryTag = "mit";
TypoSummaryTag = "Schreibweise: ";
break;
case "el":
mSummaryTag = "με τη χρήση";
WPAWB = "[[Βικιπαίδεια:AutoWikiBrowser|AWB]]";
Stub = @"[^{}|]*?([Ss]tub|[Εε]πέκταση)";
SectStub = @"\{\{θέματος";
SectStubRegex = new Regex(SectStub, RegexOptions.Compiled);
break;
case "eo":
mSummaryTag = "per";
WPAWB = "[[Vikipedio:AutoWikiBrowser|AWB]]";
TypoSummaryTag = "Skribmaniero: ";
break;
case "fa":
mSummaryTag = "";
WPAWB = "با استفاده از [[Project:AutoWikiBrowser|AWB]]";
break;
case "fr":
mSummaryTag = "avec";
WPAWB = "[[Wikipédia:AutoWikiBrowser|AWB]]";
break;
case "he":
mSummaryTag = "באמצעות";
WPAWB = "[[ויקיפדיה:AutoWikiBrowser|AWB]]";
break;
case "hi":
mSummaryTag = "";
WPAWB = "[[विकिपीडिया:ऑटोविकिब्राउज़र|AWB]] के साथ";
break;
case "hu":
mSummaryTag = "";
WPAWB = "[[Wikipédia:AutoWikiBrowser|AWB]]";
//.........这里部分代码省略.........
示例10: SetProject
/// <summary>
/// Sets different language variables, such as namespaces. Default is english Wikipedia
/// </summary>
/// <param name="langCode">The language code, default is en</param>
/// <param name="projectName">The project name default is Wikipedia</param>
/// <param name="customProject">Script path of a custom project or ""</param>
/// <param name="protocol"></param>
public static void SetProject(string langCode, ProjectEnum projectName, string customProject, string protocol)
{
TryLoadingAgainAfterLogin = false;
Namespaces.Clear();
CancelBackgroundRequests();
UnderscoredTitles.Clear();
WikiRegexes.TemplateRedirects.Clear();
Project = projectName;
LangCode = langCode;
CustomProject = customProject;
Protocol = protocol;
RefreshProxy();
URLEnd = "/w/";
Stub = "[^{}|]*?[Ss]tub";
MonthNames = ENLangMonthNames;
SectStub = @"\{\{[Ss]ect";
SectStubRegex = new Regex(SectStub, RegexOptions.Compiled);
TypoSummaryTag = "typos fixed: ";
AWBDefaultSummaryTag();
mSummaryTag = "using";
NotificationsEnabled = true;
if (IsCustomProject)
{
LangCode = "en";
var uri = new Uri(Protocol + customProject);
URLEnd = uri.AbsolutePath;
URL = protocol + uri.Host;
CustomProject = customProject;
}
else
{
URL = "https://" + LangCode + "." + Project + ".org";
}
// HACK:
switch (projectName)
{
case ProjectEnum.wikipedia:
case ProjectEnum.wikinews:
case ProjectEnum.wikisource:
case ProjectEnum.wikibooks:
case ProjectEnum.wikiquote:
case ProjectEnum.wiktionary:
case ProjectEnum.wikiversity:
//If not set the following will be used:
//mSummaryTag="using";
//WPAWB = "[[Project:Wikipedia:AutoWikiBrowser|AWB]]";
SetLanguageSpecificValues(langCode, projectName);
break;
case ProjectEnum.commons:
URL = "https://commons.wikimedia.org";
LangCode = "en";
break;
case ProjectEnum.meta:
URL = "https://meta.wikimedia.org";
LangCode = "en";
break;
case ProjectEnum.mediawiki:
URL = "https://www.mediawiki.org";
LangCode = "en";
break;
case ProjectEnum.incubator:
URL = "https://incubator.wikimedia.org";
LangCode = "en";
break;
case ProjectEnum.species:
URL = "https://species.wikimedia.org";
LangCode = "en";
break;
case ProjectEnum.wikia:
URL = "http://" + customProject + ".wikia.com";
URLEnd = "/";
break;
case ProjectEnum.custom:
break;
}
//refresh once more in case project settings were reset due to error with loading
RefreshProxy();
//HACK:HACK:HACK:HACK:HACK:
if (MainForm != null && MainForm.TheSession != null)
{
try
{
//.........这里部分代码省略.........
示例11: SetProject
/// <summary>
/// Sets different language variables, such as namespaces. Default is english Wikipedia
/// </summary>
/// <param name="langCode">The language code, default is en</param>
/// <param name="projectName">The project name default is Wikipedia</param>
/// <param name="customProject">Script path of a custom project or ""</param>
public static void SetProject(string langCode, ProjectEnum projectName, string customProject)
{
Namespaces.Clear();
CancelBackgroundRequests();
UnderscoredTitles.Clear();
foreach(var s in AttackSites)
if (customProject.Contains(s))
{
MessageBox.Show("This software does not work on attack sites.");
Application.ExitThread();
}
Project = projectName;
LangCode = langCode;
CustomProject = customProject;
RefreshProxy();
URLEnd = "/w/";
AWBDefaultSummaryTag();
Stub = "[Ss]tub";
MonthNames = ENLangMonthNames;
SectStub = @"\{\{[Ss]ect";
SectStubRegex = new Regex(SectStub, RegexOptions.Compiled);
if (IsCustomProject)
{
LangCode = "en";
int x = customProject.IndexOf('/');
if (x > 0)
{
URLEnd = customProject.Substring(x, customProject.Length - x);
customProject = customProject.Substring(0, x);
}
URL = "http://" + CustomProject;
}
else
URL = "http://" + LangCode + "." + Project + ".org";
// HACK:
switch (projectName)
{
case ProjectEnum.wikipedia:
case ProjectEnum.wikinews:
case ProjectEnum.wikisource:
case ProjectEnum.wikibooks:
case ProjectEnum.wikiquote:
case ProjectEnum.wiktionary:
case ProjectEnum.wikiversity:
switch (langCode)
{
case "en":
if (projectName == ProjectEnum.wikipedia)
SetToEnglish();
break;
case "ar":
mSummaryTag = " ";
WPAWB = "باستخدام [[ويكيبيديا:أوب|الأوتوويكي براوزر]]";
TypoSummaryTag = ".الأخطاء المصححة: ";
break;
case "bg":
mSummaryTag = " редактирано с ";
WPAWB = "AWB";
break;
case "ca":
mSummaryTag = " ";
WPAWB = "[[Viquipèdia:AutoWikiBrowser|AWB]]";
break;
case "da":
mSummaryTag = " ved brug af ";
WPAWB = "[[en:Wikipedia:AutoWikiBrowser|AWB]]";
break;
case "de":
mSummaryTag = " mit ";
TypoSummaryTag = ", Schreibweise:";
break;
case "el":
mSummaryTag = " με τη χρήση ";
WPAWB = "[[Βικιπαίδεια:AutoWikiBrowser|AWB]]";
break;
case "eo":
//.........这里部分代码省略.........
示例12: SetProject
/// <summary>
/// Sets different language variables, such as namespaces. Default is english Wikipedia
/// </summary>
/// <param name="langCode">The language code, default is en</param>
/// <param name="projectName">The project name default is Wikipedia</param>
public static void SetProject(string langCode, ProjectEnum projectName)
{
SetProject(langCode, projectName, "", false);
}
示例13: Clone
public int Clone(out IEnumHierarchies ppenum) {
ppenum = new ProjectEnum(_projects);
return VSConstants.S_OK;
}
示例14: GetProjectEnum
public int GetProjectEnum(uint grfEnumFlags, ref Guid rguidEnumOnlyThisType, out IEnumHierarchies ppenum) {
__VSENUMPROJFLAGS flags = (__VSENUMPROJFLAGS)grfEnumFlags;
ProjectInfo[] projects;
if (flags.HasFlag(__VSENUMPROJFLAGS.EPF_MATCHTYPE)) {
var guid = rguidEnumOnlyThisType;
projects = _projects.Values.Where(x => x.ProjectGuid == guid).ToArray();
} else if (flags.HasFlag(__VSENUMPROJFLAGS.EPF_ALLPROJECTS)) {
projects = _projects.Values.ToArray();
} else {
throw new NotImplementedException();
}
ppenum = new ProjectEnum(projects);
return VSConstants.S_OK;
}
示例15: SetDefaults
private static void SetDefaults()
{
mProject = ProjectEnum.wikipedia;
mLangCode = LangCodeEnum.en;
mSummaryTag = " using ";
strWPAWB = "[[Project:AWB|AWB]]";
Namespaces.Clear();
SetToEnglish();
}