コード例 #1
0
ファイル: DynamicNamespace.cs プロジェクト: nuxleus/flexwiki
		public DynamicTopic DynamicTopicFor(string topic)
		{
            if (_topics == null)
            {
                _topics = new Hashtable();
            }
			DynamicTopic answer = (DynamicTopic)(_topics[topic]);
            if (answer != null)
            {
                return answer;
            }

            TopicName topicName = new TopicName(topic); 

            NamespaceManager manager = CurrentFederation.NamespaceManagerForNamespace(Namespace);
            QualifiedTopicNameCollection alternatives = manager.AllPossibleQualifiedTopicNames(topicName); 

			foreach (QualifiedTopicName tn in alternatives)
			{
				NamespaceManager namespaceManager = CurrentFederation.NamespaceManagerForTopic(tn);
				if (!namespaceManager.TopicExists(tn.LocalName, ImportPolicy.DoNotIncludeImports))
					continue;
				answer = new DynamicTopic(CurrentFederation, new QualifiedTopicRevision(tn));
				_topics[topic] = answer;
				return answer;
			}
			return null;
		}
コード例 #2
0
ファイル: DynamicNamespace.cs プロジェクト: nuxleus/flexwiki
		public DynamicTopic DynamicTopicFor(string topic)
		{
			if (_Topics == null)
				_Topics = new Hashtable();
			DynamicTopic answer = (DynamicTopic)(_Topics[topic]);
			if (answer != null)
				return answer;

			RelativeTopicName rel = new RelativeTopicName(topic);
			ArrayList alternatives = new ArrayList();
			if (rel.Namespace != null)	// if they left the namespace unspec'd
			{			
				alternatives.Add(new AbsoluteTopicName(topic));	
			}
			else
			{
				alternatives.Add(new AbsoluteTopicName(topic, Name));	// always try this one first
				alternatives.AddRange(rel.AllAbsoluteTopicNamesFor(CurrentFederation.ContentBaseForNamespace(Name)));
			}

			foreach (AbsoluteTopicName tn in alternatives)
			{
				ContentBase cb = CurrentFederation.ContentBaseForTopic(tn);
				if (!cb.TopicExists(tn))
					continue;
				answer = new DynamicTopic(CurrentFederation, tn);
				_Topics[topic] = answer;
				return answer;
			}
			return null;
		}
コード例 #3
0
ファイル: TopicScope.cs プロジェクト: nuxleus/flexwikicore
 public TopicScope(IScope ContainingScope, DynamicTopic topic)
 {
     _ContainingScope = ContainingScope;
     _Topic = topic;
 }