• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FlexWiki.AbsoluteTopicName类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AbsoluteTopicName类属于FlexWiki命名空间,在下文中一共展示了AbsoluteTopicName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Page_Load

		private void Page_Load(object sender, System.EventArgs e)
		{
			_topicString  = Request.QueryString["topic"];
			
			try
			{
				_diff		= Convert.ToInt32(Request.QueryString["diff"]);
			}
			catch {}
			try
			{
				_oldid		= Convert.ToInt32(Request.QueryString["oldid"]);
			}
			catch {}

			try
			{
				_requestedTopic = new AbsoluteTopicName(_topicString);
			}
			catch {}

			if (_requestedTopic == null || _diff >= _oldid)
			{
				Response.Redirect("default.aspx");
			}
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:26,代码来源:Compare.aspx.cs


示例2: ControlPageTitle

		public void ControlPageTitle()
		{
			AbsoluteTopicName top = new AbsoluteTopicName("TitledTopic", TheFederation.DefaultContentBase.Namespace);
			string t = TheLinkMaker.LinkToTopic(top);
			DocumentElement doc = TheBrowser.Navigate(t, true);
			
			Assert.AreEqual("This fat hen", doc.Title);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:8,代码来源:CoreUITests.cs


示例3: ControlTopicBar

		public void ControlTopicBar()
		{
			AbsoluteTopicName top = new AbsoluteTopicName("TitledTopic", TheFederation.DefaultContentBase.Namespace);
			string t = TheLinkMaker.LinkToTopic(top);
			DocumentElement doc = TheBrowser.Navigate(t, true);
			HTMLElement staticTopicBar = (HTMLElement)doc.GetElementByName("StaticTopicBar");

			Assert.AreEqual("This fat hen", staticTopicBar.InnerText);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:9,代码来源:CoreUITests.cs


示例4: 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(AbsoluteTopicName topic, OutputFormat format, bool showDiffs, Federation aFederation, LinkMaker lm, CompositeCacheRule accumulator)
		{ 
		
			// Show the current topic (including diffs if there is a previous version)
			AbsoluteTopicName previousVersion = null;
			ContentBase relativeToBase = aFederation.ContentBaseForNamespace(topic.Namespace);

			if (showDiffs)
				previousVersion = relativeToBase.VersionPreviousTo(topic.LocalName);

			return FormattedTopicWithSpecificDiffs(topic, format, previousVersion, aFederation, lm, accumulator);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:20,代码来源:Formatter.cs


示例5: Print

		static void Print(Federation federation, AbsoluteTopicName topic)
		{
			string formattedBody = federation.GetTopicFormattedContent(topic, null);

			// Now calculate the borders
			string leftBorder = federation.GetTopicFormattedBorder(topic, Border.Left);
			string rightBorder =federation.GetTopicFormattedBorder(topic, Border.Right);
			string topBorder = federation.GetTopicFormattedBorder(topic, Border.Top);
			string bottomBorder = federation.GetTopicFormattedBorder(topic, Border.Bottom);

//			Console.Out.WriteLine(formattedBody);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:12,代码来源:PrintTopic.cs


示例6: FormattedString

		/// <summary>
		/// Format a string of wiki content in a given OutputFormat with references all being relative to a given namespace
		/// </summary>
		/// <param name="topic">Topic context</param>
		/// <param name="input">The input wiki text</param>
		/// <param name="format">The desired output format</param>
		/// <param name="relativeToContentBase">References will be relative to this namespace</param>
		/// <param name="lm">Link maker (unless no relativeTo content base is provide)</param>
		/// <param name="accumulator">composite cache rule in which to accumulate cache rules</param>
		/// <returns></returns>
		public static string FormattedString(AbsoluteTopicName topic, string input, OutputFormat format, ContentBase relativeToContentBase, LinkMaker lm, CompositeCacheRule accumulator)
		{
			// TODO -- some of the cases in which this call happens actually *are* nested, even though the false arg
			// below says that they aren't.  This causes scripts to be emitted multiple times -- should clean up.
			WikiOutput output = WikiOutput.ForFormat(format, null);	
			Hashtable ew;
      if (relativeToContentBase != null)
      {
        ew = relativeToContentBase.ExternalWikiHash();
      }
      else
      {
        ew = new Hashtable();
      }
			Format(topic, input, output, relativeToContentBase, lm, ew, 0, accumulator);
			return output.ToString();
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:27,代码来源:Formatter.cs


示例7: CalendarStore

		public CalendarStore(Federation fed, string ns, int year, int month)
		{
			SetFederation(fed);
			Namespace = ns;
			Year = year;
			Month = month;
			foreach (DateTime each in Dates)
			{
				AbsoluteTopicName abs = TopicNameForDate(each);
				_Topics[abs] = each;
				_Topics[abs.LocalName] = each;
			}

			AbsoluteTopicName a = new AbsoluteTopicName("_NormalBorders", Namespace);
			BackingTopic top = new BackingTopic(a, DefaultNormalBordersContent, true);
			BackingTopics[a.Name] = top;
			_Topics[a] = DateTime.MinValue;
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:18,代码来源:CalendarStore.cs


示例8: GetTopicSpacedLines

        public static ArrayList GetTopicSpacedLines( string topicName )
        {
            #if WIKI
            AbsoluteTopicName topic = new AbsoluteTopicName(topicName);
            ContentBase cb = GetFederation().ContentBaseForNamespace(topic.Namespace);

            using (TextReader sr = cb.TextReaderForTopic(topic)) 	{
                ArrayList lines = new ArrayList();
                string line = null;
                while( (line = sr.ReadLine()) != null ) {
                    if( line.StartsWith(" ") ) 	{
                        lines.Add(line.Trim());
                    }
                }
                return lines;
            }
            #else
            return new ArrayList();
            #endif
        }
开发者ID:zi-yu,项目名称:orionsbelt,代码行数:20,代码来源:Wiki.cs


示例9: CreateTestPage

		public void CreateTestPage()
		{
			AbsoluteTopicName top = new AbsoluteTopicName("DummyPage", TheFederation.DefaultContentBase.Namespace);

			bool exists;
			
			exists = TheFederation.TopicExists(top);
			Assert.IsTrue(!exists);

			string home = TheLinkMaker.LinkToTopic(top);
			DocumentElement doc = TheBrowser.Navigate(home, true);
			Assert.IsTrue(doc.Body.OuterHTML.IndexOf("Formatting Tips") > 0);
			InputElement text = (InputElement) doc.GetElementByName("Text1");
			text.Value = "This is SoCool!";
			ButtonElement save = (ButtonElement) doc.GetElementByName("SaveButton");

			save.Click(true);
			// Make sure it actually got saved
			exists = TheFederation.TopicExists(top);
			Assert.IsTrue(exists);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:21,代码来源:CoreUITests.cs


示例10: Formatter

		/// <summary>
		/// Create a new formatter for a string of input content.
		/// </summary>
		/// <param name="source">Input wiki string</param>
		/// <param name="output">Output object to which output is sent</param>
		/// <param name="contentBase">The ContentBase that contains the wiki string text</param>
		/// <param name="maker">A link maker </param>
		/// <param name="external">External wiki map</param>
		/// <param name="headingLevelBase">Relative heading level</param>
		/// <param name="accumulator">composite cache rule in which to accumulate cache rules</param>
		/// 
		Formatter(AbsoluteTopicName topic, string source, WikiOutput output, ContentBase contentBase, LinkMaker maker, Hashtable external, int headingLevelBase, CompositeCacheRule accumulator)
		{
			_Topic = topic;
			_Source = SplitStringIntoStyledLines(source, LineStyle.Unchanged);
			_LinkMaker = maker;	
			ContentBase = contentBase;
			_Output = output;
			_ExternalWikiMap = external;
			_HeadingLevelBase = headingLevelBase;
			_CacheRuleAccumulator = accumulator;
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:22,代码来源:Formatter.cs


示例11: WikiToPresentation

		static public IWikiToPresentation WikiToPresentation(AbsoluteTopicName topic, WikiOutput output, ContentBase contentBase, LinkMaker maker, Hashtable external, int headingLevelBase, CompositeCacheRule accumulator)
		{
			ArrayList lines = new ArrayList();
			lines.Add(new StyledLine("", LineStyle.Unchanged));
			return new Formatter(topic, lines, output, contentBase, maker, external,  headingLevelBase, accumulator);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:6,代码来源:Formatter.cs


示例12: Format

		/// <summary>
		/// Format a given input string to the given output
		/// </summary>
		/// <param name="source">Input wiki content as a list of StyledLines</param>
		/// <param name="output">Output object to which output is sent</param>
		/// <param name="contentBase">The ContentBase that contains the wiki string text</param>
		/// <param name="maker">A link maker </param>
		/// <param name="external">External wiki map</param>
		/// <param name="headingLevelBase">Relative heading level</param>
		/// <param name="accumulator">composite cache rule in which to accumulate cache rules</param>
		/// 
		static public void Format(AbsoluteTopicName topic, IList source, WikiOutput output, ContentBase contentBase, LinkMaker maker, Hashtable external, int headingLevelBase, CompositeCacheRule accumulator)
		{
			Formatter f = new Formatter(topic, source, output, contentBase, maker, external, headingLevelBase, accumulator);
			f.Format();
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:16,代码来源:Formatter.cs


示例13: LinkWikiNames

		private string LinkWikiNames (string input)
		{
			StringBuilder answer = new StringBuilder();

			string str = input;
			ArrayList processed = new ArrayList();
			while (str.Length > 0)
			{
				Match m = extractWikiLinks.Match(str);
				if (!m.Success)
					break;
				string each = m.Groups["topic"].ToString();
				string before = m.Groups["before"].ToString();
				string after = m.Groups["after"].ToString();
				string relabel = m.Groups["relabel"].ToString();
				string anchor = m.Groups["anchor"].ToString();
				
				RelativeTopicName relName = new RelativeTopicName(TopicName.StripEscapes(each));

				// Ignore apparent links to non-existent namespaces.
				if ((null == relName.Namespace) || (null != TheFederation.ContentBaseForNamespace(relName.Namespace)))
				{
					// Build a list of all the possible absoluteNames for this topic
					ArrayList absoluteNames = new ArrayList();
					// Start with the singulars in the various reachable namespaces, then add the plurals
					absoluteNames.AddRange(ContentBase.AllAbsoluteTopicNamesThatExist(relName));
					AddCacheRule(ContentBase.CacheRuleForAllPossibleInstancesOfTopic(relName));
					foreach (TopicName alternate in relName.AlternateForms)
					{
						AddCacheRule(ContentBase.CacheRuleForAllPossibleInstancesOfTopic(alternate));
						absoluteNames.AddRange(ContentBase.AllAbsoluteTopicNamesThatExist(alternate));
					}
					
					// Now see if we got any hits or not
					string rep = beforeOrRelabel + "(" + RegexEscapeTopic(each) + ")" + afterWikiName;
					AbsoluteTopicName appearedAs = new AbsoluteTopicName(each);  // in case it was a plural form, be sure to show it as it appeared
					string displayname = TopicName.StripEscapes((ContentBase.DisplaySpacesInWikiLinks ? appearedAs.FormattedName : appearedAs.Name));
					if (relabel.Length > 0)
					{
						displayname = relabel;
					}

					if (absoluteNames.Count == 0)
					{
						if (!IsUnbracketedOneWordName(each))
						{
							// It doesn't exist, so give the option to create it
							AbsoluteTopicName abs = relName.AsAbsoluteTopicName(ContentBase.Namespace);
							str = ReplaceMatch(answer, str, m, before + "<a title=\"Click here to create this topic\" class=\"create\" href=\"" + LinkMaker().LinkToEditTopic(abs) + "\">" + displayname + "</a>" + after);
						}
						else
							str = ReplaceMatch(answer, str, m, m.Value);
					}
					else
					{
						// We got hits, let's add links

						if (absoluteNames.Count == 1)
						{
							// The simple case is that there's only one link to point to, so we output just a normal link
							AbsoluteTopicName abs = (AbsoluteTopicName)absoluteNames[0];
							string tip = TipForTopic(abs);
							string tipid = null;
							string tipHTML = null;
							bool defaultTip = tip == null;
							if (defaultTip)
							{
								tip = "Click to read this topic";
							}
							tipid = NewUniqueIdentifier();
							tipHTML = Formatter.EscapeHTML(tip);
							if (defaultTip)
							{
								tipHTML = "<span class=\"DefaultTopicTipText\">" + tipHTML + "</span>";
							}
							tipHTML += "<div class=\"TopicTipStats\">" + TheFederation.GetTopicModificationTime(abs).ToString() + " - " + TheFederation.GetTopicLastModifiedBy(abs) + "</div>";
							tipHTML = "<div id=" + tipid +" style=\"display: none\">" + tipHTML + "</div>";
							Output.AddToFooter(tipHTML);
							string replacement = "<a ";
							if (tip != null)
							{
								replacement += "onmouseover=\"TopicTipOn(this, '" + tipid + "', event);\" onmouseout=\"TopicTipOff();\" ";
							}
							replacement += "href=\"" + LinkMaker().LinkToTopic(abs);
							if (anchor.Length > 0)
							{
								replacement += "#" + anchor;
								if (0 == relabel.Length)
								{
									displayname += "#" + anchor;
								}
							}
							replacement += "\">" + displayname + "</a>";
							str = ReplaceMatch(answer, str, m, before + replacement + after) ;
						}
						else
						{
							// There's more than one; we need to generate a dynamic menu
							string clickEvent;
							clickEvent = "onclick=\"javascript:LinkMenu(new Array(";
//.........这里部分代码省略.........
开发者ID:nuxleus,项目名称:flexwiki,代码行数:101,代码来源:Formatter.cs


示例14: TipForTopic

		private string TipForTopic(AbsoluteTopicName topic)
		{
			string answer = TheFederation.GetTopicProperty(topic, "Summary");
			if (answer == "")
				answer = null;
			return answer;
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:7,代码来源:Formatter.cs


示例15: IncludedTopic

		private string IncludedTopic(TopicName topic, int headingLevelBase)
		{
			// TODO: how do we identify specific versions? [maybe this just works now? since versionids are a formal part of a wikiname???]
			// TODO: how do we show diffs?
			string ns = ContentBase.UnambiguousTopicNamespace(topic);
			ContentBase containingContentBase = TheFederation.ContentBaseForNamespace(ns);
			AbsoluteTopicName abs = new AbsoluteTopicName(topic.Name, ns);
			string content = containingContentBase.Read(abs.LocalName).TrimEnd();
			WikiOutput output = WikiOutput.ForFormat(_Output.Format, Output);
			Formatter.Format(abs, content, output, ContentBase, LinkMaker(), _ExternalWikiMap, headingLevelBase, CacheRuleAccumulator);
			return output.ToString().Trim();
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:12,代码来源:Formatter.cs


示例16: FormattedTestText

		string FormattedTestText(string inputString, AbsoluteTopicName top)
		{
			WikiOutput output = WikiOutput.ForFormat(OutputFormat.Testing, null);
			Formatter.Format(top, inputString, output,  _cb, _lm, _externals, 0, null);
			string o = output.ToString();
			string o1 = o.Replace("\r", "");
			return o1;
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:8,代码来源:FormatterTests.cs


示例17: GetTopicName

		protected AbsoluteTopicName GetTopicName()
		{
			string topic;
			
			topic = Request.PathInfo;
			if (topic.StartsWith("/"))
				topic = topic.Substring(1);

			// See if we're dealign with old style references or new ones
			// OLD: My.Name.Space.Topic
			// NEW: My.Name.Space/Topic.html
			bool isNewStyle = topic.IndexOf("/") != -1;	// if we have a slash, it's new

			// OK, we've got the namespace and the name now
			AbsoluteTopicName abs;
			if (topic == null || topic.Length == 0)
			{
				abs = new AbsoluteTopicName(DefaultContentBase.HomePage, DefaultContentBase.Namespace);
			}
			else
			{
				if (isNewStyle)
				{
					string ns, top;
					int slash = topic.IndexOf("/");
					ns = topic.Substring(0, slash);
					top = topic.Substring(slash + 1);

					int tailDot = top.LastIndexOf(".");
					if (tailDot != -1)
						top = top.Substring(0, tailDot);	// trim of the extension (e.g., ".html")

					abs = new AbsoluteTopicName(ns + "." + top);
				}
				else
				{
					abs = new AbsoluteTopicName(topic);
				}
			}
			return abs;
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:41,代码来源:BasePage.cs


示例18: 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(AbsoluteTopicName topic, OutputFormat format, AbsoluteTopicName previousVersion, Federation aFederation, LinkMaker lm, CompositeCacheRule accumulator)
		{ 
			ContentBase relativeToBase = aFederation.ContentBaseForNamespace(topic.Namespace);
			return FormattedTopicWithSpecificDiffs(topic, format, previousVersion, aFederation, lm, accumulator);
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:13,代码来源:Formatter.cs


示例19: DynamicTopic

		public DynamicTopic(Federation aFed, AbsoluteTopicName name)
		{
			_CurrentFederation = aFed;
			_Name = name;
		}
开发者ID:nuxleus,项目名称:flexwiki,代码行数:5,代码来源:DynamicTopic.cs


示例20: FormatTest

		void FormatTest(string inputString, string outputString, AbsoluteTopicName top)
		{
			string o1 = FormattedTestText(inputString, top);
			string o2 = outputString.Replace("\r", "");
			if (o1 != o2)
			{
				Console.Error.WriteLine("Got     : " + o1);
				Console.Error.WriteLine("Expected: " + o2);
			}
			Assert.AreEqual(o2, o1);
		}			
开发者ID:nuxleus,项目名称:flexwiki,代码行数:11,代码来源:FormatterTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FlexWiki.ExecutionContext类代码示例发布时间:2022-05-24
下一篇:
C# Fleck.WebSocketServer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap