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


C# Federation.NamespaceManagerForNamespace方法代码示例

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


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

示例1: FormattedTopic

 /// <summary>
 /// Answer the formatted text for a given topic, formatted using a given OutputFormat and possibly showing diffs with the previous revision
 /// </summary>
 /// <param name="topic">The topic</param>
 /// <param name="format">What format</param>
 /// <param name="showDiffs">true to show diffs</param>
 /// <param name="accumulator">composite cache rule in which to accumulate cache rules</param>
 /// <returns></returns>
 public static string FormattedTopic(QualifiedTopicRevision topic, OutputFormat format, QualifiedTopicRevision previousVersion, Federation aFederation, LinkMaker lm)
 {
     NamespaceManager relativeToBase = aFederation.NamespaceManagerForNamespace(topic.Namespace);
     return FormattedTopicWithSpecificDiffs(topic, format, previousVersion, aFederation, lm);
 }
开发者ID:nuxleus,项目名称:flexwikicore,代码行数:13,代码来源:Formatter.cs

示例2: FormattedTopicWithSpecificDiffs

        /// <summary>
        /// Answer the formatted text for a given topic, formatted using a given OutputFormat and possibly showing diffs
        /// with a specified revision
        /// </summary>
        /// <param name="topic">The topic</param>
        /// <param name="format">What format</param>
        /// <param name="showDiffs">true to show diffs</param>
        /// <param name="accumulator">composite cache rule in which to accumulate cache rules (ignored for diffs)</param>
        /// <returns></returns>
        public static string FormattedTopicWithSpecificDiffs(QualifiedTopicRevision topic, OutputFormat format, QualifiedTopicRevision diffWithThisVersion, Federation aFederation, LinkMaker lm)
        {
            // Setup a special link maker that knows what to make the edit links return to
            LinkMaker linker = lm.Clone();
            linker.ReturnToTopicForEditLinks = topic;
            NamespaceManager relativeToBase = aFederation.NamespaceManagerForNamespace(topic.Namespace);

            WikiOutput output = WikiOutput.ForFormat(format, null);
            if (diffWithThisVersion != null)
            {
                ArrayList styledLines = new ArrayList();
                IList leftLines;
                IList rightLines;
                using (TextReader srLeft = relativeToBase.TextReaderForTopic(topic.AsUnqualifiedTopicRevision()))
                {
                    leftLines = MergeBehaviorLines(srLeft.ReadToEnd().Replace("\r", "").Split('\n'));
                }
                using (TextReader srRight = relativeToBase.TextReaderForTopic(diffWithThisVersion.AsUnqualifiedTopicRevision()))
                {
                    rightLines = MergeBehaviorLines(srRight.ReadToEnd().Replace("\r", "").Split('\n'));
                }
                IEnumerable diffs = Diff.Compare(leftLines, rightLines);
                foreach (LineData ld in diffs)
                {
                    LineStyle style = LineStyle.Unchanged;
                    switch (ld.Type)
                    {
                        case LineType.Common:
                            style = LineStyle.Unchanged;
                            break;

                        case LineType.LeftOnly:
                            style = LineStyle.Add;
                            break;

                        case LineType.RightOnly:
                            style = LineStyle.Delete;
                            break;
                    }
                    styledLines.Add(new StyledLine(ld.Text, style));
                }
                Format(topic, styledLines, output, relativeToBase, linker, relativeToBase.ExternalReferences, 0);
            }
            else
            {
                using (TextReader sr = relativeToBase.TextReaderForTopic(topic.AsUnqualifiedTopicRevision()))
                {
                    Format(topic, sr.ReadToEnd(), output, relativeToBase, linker, relativeToBase.ExternalReferences, 0);
                }
            }

            return output.ToString();
        }
开发者ID:nuxleus,项目名称:flexwikicore,代码行数:62,代码来源:Formatter.cs

示例3: UpdateNamespaces

 public void UpdateNamespaces(Federation aFed)
 {
     // just kill the old one and reload a new one
     aFed.UnregisterNamespace(aFed.NamespaceManagerForNamespace(Namespace));
     LoadNamespaces(aFed);
 }
开发者ID:nuxleus,项目名称:flexwiki,代码行数:6,代码来源:FileSystemNamespaceProvider.cs

示例4: ValidateParameter

        public string ValidateParameter(Federation aFed, string param, string val, bool isCreate)
        {
            if (param == c_namespace)
            {
                if (val == "" || val == null)
                    return "Namespace can not be blank";
                if (isCreate && aFed.NamespaceManagerForNamespace(val) != null)
                    return "Namespace already exists";
                // TODO -- check other constraints (valid chars) for namespaces
            }

            return null;
        }
开发者ID:nuxleus,项目名称:flexwiki,代码行数:13,代码来源:FileSystemNamespaceProvider.cs

示例5: ValidateDefaultNamespace

        private void ValidateDefaultNamespace(Federation aFed)
        {
            ///////////
            ///Make sure the default namespace is configured
            string defaultNamespace = aFed.Configuration.DefaultNamespace;
            if (defaultNamespace == null)
            {
                Result r = new Result("Default namespace not specified", Level.Error);
                r.Writer.Write(@"<p>You have not specified the default namespace for your federation in the federation configuration file (<b>" + HtmlWriter.Escape(ApplicationConfigurationPath) + @"</b>).
            This setting must be present and must name a namespace listed in your configuration file. <p>Here is an example of a valid federation configuration file:");
                r.Writer.Write(ExampleConfig());
                AddResult(r);
                return;
            }

            if (aFed.NamespaceManagerForNamespace(defaultNamespace) == null)
            {
                Result r = new Result("Default namespace not found", Level.Error);
                r.Writer.Write(@"<p>You have specified the default namespace for your federation in the federation configuration file (<b>" + HtmlWriter.Escape(ApplicationConfigurationPath) + @"</b>),
            but the namespace you specified can not be found (either because it's not listed in the configuration file or it's not valid).
            <p>Here is an example of a valid federation configuration file:");
                r.Writer.Write(ExampleConfig());
                AddResult(r);
                return;
            }

            OK("Valid default namespace setting detected: " + HtmlWriter.Escape(defaultNamespace));
        }
开发者ID:nuxleus,项目名称:flexwikicore,代码行数:28,代码来源:ConfigurationChecker.cs

示例6: ValidateParameter

 /// <summary>
 /// Validate the parameters for creating the Namespace.
 /// </summary>
 /// <param name="param">Parameters name</param>
 /// <param name="val">Parameter value to validate.</param>
 /// <returns>returns null to indicate success otherwise returns 
 /// the error message to be displayed.</returns>
 public string ValidateParameter(Federation aFed, string param, string val, bool isCreate)
 {
     if (param == ConfigurationParameterNames.Namespace)
     {
         // Would need to be consistent with the namespace
         // names for the FileSystemNameSpaceProvider
         if (val == "" || val == null)
             return "Namespace can not be blank";
         if (isCreate && aFed.NamespaceManagerForNamespace(val) != null)
             return "Namespace already exists";
     }
     else if (param == ConfigurationParameterNames.ConnectionString)
     {
         if (val == "")
             return "ConnectionString can not be null or blank";
     }
     return null;
 }
开发者ID:nuxleus,项目名称:flexwikicore,代码行数:25,代码来源:SqlNamespaceProvider.cs

示例7: UpdateNamespaces

 public void UpdateNamespaces(Federation aFed)
 {
     // just kill the old ones and reload new ones
     foreach (string each in NamespaceNames)
         aFed.UnregisterNamespace(aFed.NamespaceManagerForNamespace(each));
     LoadNamespaces(aFed);
 }
开发者ID:nuxleus,项目名称:flexwikicore,代码行数:7,代码来源:CalendarNamespaceProvider.cs


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