本文整理汇总了C#中AbsoluteTopicName类的典型用法代码示例。如果您正苦于以下问题:C# AbsoluteTopicName类的具体用法?C# AbsoluteTopicName怎么用?C# AbsoluteTopicName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbsoluteTopicName类属于命名空间,在下文中一共展示了AbsoluteTopicName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCacheRuleForTopic
private CacheRule GetCacheRuleForTopic(string topic)
{
AbsoluteTopicName tn = new AbsoluteTopicName(topic);
CompositeCacheRule rule = new CompositeCacheRule();
Formatter.FormattedTopic(tn, OutputFormat.Testing, null, Federation, _lm, rule);
return rule;
}
示例2: AbsoluteTopicName
string IEditServiceProxy.GetTextForTopic(LocalTopic topic)
{
AbsoluteTopicName atn = new AbsoluteTopicName();
atn.Namespace = topic.Namespace.Name;
atn.Name = topic.Name;
return base.GetTextForTopic(atn);
}
示例3: TestFederationPropagationOfContentBaseFederationUpdates
[Test] public void TestFederationPropagationOfContentBaseFederationUpdates()
{
AbsoluteTopicName tn = new AbsoluteTopicName("EventTest", _base.Namespace);
_base.WriteTopic(tn.LocalName, @"Stay1: hello
Stay2: foo
Go1: foo
Go2: foo
Change1: blag
Change2: blag
");
FederationUpdate expected = new FederationUpdate();
expected.RecordPropertyChange(tn, "_ModificationTime", FederationUpdate.PropertyChangeType.PropertyUpdate);
expected.RecordPropertyChange(tn, "_Body", FederationUpdate.PropertyChangeType.PropertyUpdate);
expected.RecordPropertyChange(tn, "Go1", FederationUpdate.PropertyChangeType.PropertyRemove);
expected.RecordPropertyChange(tn, "Go2", FederationUpdate.PropertyChangeType.PropertyRemove);
expected.RecordPropertyChange(tn, "Change1", FederationUpdate.PropertyChangeType.PropertyUpdate);
expected.RecordPropertyChange(tn, "Change2", FederationUpdate.PropertyChangeType.PropertyUpdate);
StartMonitoringFederationEvents();
_base.WriteTopic(tn.LocalName, @"Stay1: hello
Stay2: foo
Change1: new value
Change2: new value
");
StopMonitoringFederationEvents();
ContentBaseTests.CompareFederationUpdates(expected, _Events, false, true);
}
示例4: AddRange
/// <summary>
/// Adds the elements of an array to the end of this AbsoluteTopicNameCollection.
/// </summary>
/// <param name="items">
/// The array whose elements are to be added to the end of this AbsoluteTopicNameCollection.
/// </param>
public virtual void AddRange(AbsoluteTopicName[] items)
{
foreach (AbsoluteTopicName item in items)
{
this.List.Add(item);
}
}
示例5: DoPage
protected void DoPage()
{
LinkMaker lm = TheLinkMaker;
string body = Request.Form["body"];
string ns = Request.Form["defaultNamespace"];
string tn = Request.Form["topic"];
AbsoluteTopicName topicName = new AbsoluteTopicName(tn, ns);
Response.Write("<div class='PreviewMain'>");
Response.Write(Formatter.FormattedString(topicName, body, OutputFormat.HTML, TheFederation.ContentBaseForNamespace(ns), TheLinkMaker, null));
Response.Write("</div>");
Response.Write(@"<div id='TopicTip' class='TopicTip' ></div>");
}
示例6: GetAllTopics
public AbsoluteTopicName[] GetAllTopics(ContentBase cb)
{
Hashtable ns = (Hashtable) namespaces[cb.Namespace];
ArrayList atns = new ArrayList();
foreach (string topic in ns.Keys)
{
AbsoluteTopicName atn = new AbsoluteTopicName();
atn.Namespace = cb.Namespace;
atn.Name = topic;
atn.Version = GetLatestVersion((Hashtable) ns[topic]);
atns.Add(atn);
}
return (AbsoluteTopicName[]) atns.ToArray(typeof(AbsoluteTopicName));
}
示例7: ShowPage
protected void ShowPage()
{
string topicString = Request.QueryString["topic"];
AbsoluteTopicName topic = new AbsoluteTopicName(topicString);
Response.Write("<h1>All Versions for " + topic.Fullname + "</h1>");
IEnumerable changeList = TheFederation.GetTopicChanges(topic);
// Now generate the page!
bool first = true;
string mostRecentVersion = null;
foreach (TopicChange change in changeList)
{
if (first)
mostRecentVersion = change.Version;
string s = "";
if (change.Version == topic.Version || (first && topic.Version == null))
{
s += "→ ";
}
else
s += " ";
if (change.Timestamp.Date == DateTime.Now.Date)
s += change.Timestamp.ToString("HH:mm");
else
{
if (change.Timestamp.Date.Year == DateTime.Now.Date.Year)
s += change.Timestamp.ToString("MMM d H:mm");
else
s += change.Timestamp.ToString("MMM d yyyy H:mm");
}
s += " (" + change.Author + ")";
AbsoluteTopicName linkTo = change.Topic;
if (first)
linkTo.Version = null; // don't include the version for the latest one
Response.Write("<li><a href='" + TheLinkMaker.LinkToTopic(linkTo) + "'>" + s + "</a>");
first = false;
}
}
示例8: AbsoluteTopicNameCollection
/// <summary>
/// Initializes a new instance of the AbsoluteTopicNameCollection class, containing elements
/// copied from an array.
/// </summary>
/// <param name="items">
/// The array whose elements are to be added to the new AbsoluteTopicNameCollection.
/// </param>
public AbsoluteTopicNameCollection(AbsoluteTopicName[] items)
{
this.AddRange(items);
}
示例9: GetVersionsForTopic
private void GetVersionsForTopic(AbsoluteTopicName topicName)
{
flatComboBoxVersion.Items.Clear();
buttonItemRestore.Enabled = false;
string[] versions = editService.GetVersionsForTopic(topicName);
if (versions.Length > 0)
{
foreach (string s in versions)
{
flatComboBoxVersion.Items.Add(s);
}
flatComboBoxVersion.SelectedIndex = 0;
}
}
示例10: RestoreTopic
public void RestoreTopic(AbsoluteTopicName topicName, string visitorIdentityString, string version)
{
this.Invoke("RestoreTopic", new object[] {
topicName,
visitorIdentityString,
version});
}
示例11: TestTopicUpdateEvent
public void TestTopicUpdateEvent()
{
AbsoluteTopicName tn = new AbsoluteTopicName("EventTest", _base.Namespace);
FederationUpdate expected = new FederationUpdate();
expected.RecordUpdatedTopic(tn);
_base.WriteTopic(tn.LocalName, "hello");
StartMonitoringEvents(_base);
_base.WriteTopic(tn.LocalName, "second should be an update");
StopMonitoringEvents(_base);
CompareFederationUpdates(expected, _Events, true, false);
}
示例12: GetHtmlForTopicVersion
public string GetHtmlForTopicVersion(AbsoluteTopicName topicName, string version)
{
object[] results = this.Invoke("GetHtmlForTopicVersion", new object[] {
topicName,
version});
return ((string)(results[0]));
}
示例13: GetTextForTopic
public string GetTextForTopic(AbsoluteTopicName topicName)
{
object[] results = this.Invoke("GetTextForTopic", new object[] {
topicName});
return ((string)(results[0]));
}
示例14: BeginRestoreTopic
/// <remarks/>
public System.IAsyncResult BeginRestoreTopic(AbsoluteTopicName topicName, string visitorIdentityString, string version, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("RestoreTopic", new object[] {
topicName,
visitorIdentityString,
version}, callback, asyncState);
}
示例15: BeginGetPreviewForTopic
/// <remarks/>
public System.IAsyncResult BeginGetPreviewForTopic(AbsoluteTopicName topicName, string textToFormat, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetPreviewForTopic", new object[] {
topicName,
textToFormat}, callback, asyncState);
}