当前位置: 首页>>代码示例>>C#>>正文


C# ProjectEnum.Equals方法代码示例

本文整理汇总了C#中ProjectEnum.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectEnum.Equals方法的具体用法?C# ProjectEnum.Equals怎么用?C# ProjectEnum.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectEnum的用法示例。


在下文中一共展示了ProjectEnum.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetProject


//.........这里部分代码省略.........
                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
                {
                    if (!MainForm.TheSession.UpdateProject(false))
                    {
                        LangCode = "en";
                        Project = ProjectEnum.wikipedia;
                        SetToEnglish();
                    }
                }
                catch (ReadApiDeniedException)
                {
                    TryLoadingAgainAfterLogin = true;
                    ReloadProjectSettings = new ProjectHoldArea
                                                {
                                                    projectName = projectName,
                                                    customProject = customProject,
                                                    langCode = langCode,
                                                    protocol = Protocol
                                                };
                    return;
                }
            }

            RegenerateRegexes();

            RetfPath = Namespaces[Namespace.Project] + "AutoWikiBrowser/Typos";

            if(MainForm != null)
                MainForm.LoadTypos(true);

            foreach (string s in Namespaces.Values)
            {
                System.Diagnostics.Trace.Assert(s.EndsWith(":"), "Internal error: namespace does not end with ':'.",
                                                "Please contact a developer.");
            }
            System.Diagnostics.Trace.Assert(!Namespaces.ContainsKey(0), "Internal error: key exists for namespace 0.",
                                            "Please contact a developer.");

            if (projectName.Equals(ProjectEnum.wiktionary))
                CapitalizeFirstLetter = false;
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:101,代码来源:Variables.cs

示例2: SetProject


//.........这里部分代码省略.........

                        case "uk":
                            Stub = ".*?(?:[Ss]tub|[Дд]оробити)";
                            mSummaryTag = " за допомогою ";
                            WPAWB = "[[Вікіпедія:AutoWikiBrowser|AWB]]";
                            break;

                        case "zh":
                            mSummaryTag = "由";
                            WPAWB = "[[维基百科:自动维基浏览器|自动维基浏览器]]协助";
                            break;

                        case "zh-classical":
                            mSummaryTag = "藉";
                            WPAWB = "[[维基百科:自动维基浏览器|自動維基瀏覽器]]之助";
                            break;

                        case "zh-yue":
                            mSummaryTag = "由";
                            WPAWB = "[[维基百科:自动维基浏览器|自動維基瀏覽器]]協助";
                            break;

                            // case "xx:
                            // strsummarytag = " ";
                            // strWPAWB = "";
                            // break;
                    }
                    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
                {
                    if (!MainForm.TheSession.UpdateProject(false))
                    {
                        LangCode = "en";
                        Project = ProjectEnum.wikipedia;
                        SetToEnglish();
                    }
                }
                catch (ReadApiDeniedException)
                {
                    TryLoadingAgainAfterLogin = true;
                    ReloadProjectSettings = new ProjectHoldArea
                                                {
                                                    projectName = projectName,
                                                    customProject = customProject,
                                                    langCode = langCode,
                                                    protocol = Protocol
                                                };
                    return;
                }
            }

            RegenerateRegexes();

            RetfPath = Namespaces[Namespace.Project] + "AutoWikiBrowser/Typos";

            foreach (string s in Namespaces.Values)
            {
                System.Diagnostics.Trace.Assert(s.EndsWith(":"), "Internal error: namespace does not end with ':'.",
                                                "Please contact a developer.");
            }
            System.Diagnostics.Trace.Assert(!Namespaces.ContainsKey(0), "Internal error: key exists for namespace 0.",
                                            "Please contact a developer.");

            if (projectName.Equals(ProjectEnum.wiktionary))
                CapitalizeFirstLetter = false;
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:101,代码来源:Variables.cs

示例3: SetProject


//.........这里部分代码省略.........
                            break;

                        case "nl":
                            mSummaryTag = " met ";
                            break;

                        case "pl":
                            SectStub = @"\{\{[Ss]ek";
                            SectStubRegex = new Regex(SectStub, RegexOptions.Compiled);
                            break;

                        case "pt":
                            mSummaryTag = " utilizando ";
                            break;

                        case "ru":
                            mSummaryTag = " с помощью ";
                            Stub = "[^{}]*?(?:[Ss]tub|[Зз]аготовка)";
                            break;

                        case "sk":
                            mSummaryTag = " ";
                            WPAWB = "[[Wikipédia:AutoWikiBrowser|AWB]]";
                            break;

                        case "sl":
                            mSummaryTag = " ";
                            WPAWB = "[[Wikipedija:AutoWikiBrowser|AWB]]";
                            Stub = "(?:[^{}]*?[Ss]tub|[Šš]krbina[^{}]*?)";
                            break;

                        case "uk":
                            Stub = ".*?(?:[Ss]tub|[Дд]оробити)";
                            mSummaryTag = " за допомогою ";
                            WPAWB = "[[Вікіпедія:AutoWikiBrowser|AWB]]";
                            break;

                        // case "xx:
                        // strsummarytag = " ";
                        // strWPAWB = "";
                        // break;

                        default:
                            break;
                    }
                    break;
                case ProjectEnum.commons:
                    URL = "http://commons.wikimedia.org";
                    LangCode = "en";
                    break;
                case ProjectEnum.meta:
                    URL = "http://meta.wikimedia.org";
                    LangCode = "en";
                    break;
                case ProjectEnum.mediawiki:
                    URL = "http://www.mediawiki.org";
                    LangCode = "en";
                    break;
                case ProjectEnum.species:
                    URL = "http://species.wikimedia.org";
                    LangCode = "en";
                    break;
                case ProjectEnum.wikia:
                    URL = "http://" + customProject + ".wikia.com";
                    URLEnd = "/";
                    break;
                case ProjectEnum.custom:
                    URLEnd = "";
                    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)
            {
                if (!MainForm.TheSession.UpdateProject())
                {
                    LangCode = "en";
                    Project = ProjectEnum.wikipedia;
                    SetToEnglish();
                }
            }

            RegenerateRegexes();

            RetfPath = Namespaces[Namespace.Project] + "AutoWikiBrowser/Typos";

            foreach (string s in Namespaces.Values)
            {
                System.Diagnostics.Trace.Assert(s.EndsWith(":"), "Internal error: namespace does not end with ':'.",
                                                "Please contact a developer.");
            }
            System.Diagnostics.Trace.Assert(!Namespaces.ContainsKey(0), "Internal error: key exists for namespace 0.",
                                            "Please contact a developer.");
            
            if(projectName.Equals(ProjectEnum.wiktionary))
              CapitalizeFirstLetter = false;
        }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:101,代码来源:Variables.cs


注:本文中的ProjectEnum.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。