/// <summary>
		/// Adds the elements of another AbsoluteTopicNameCollection to the end of this AbsoluteTopicNameCollection.
		/// </summary>
		/// <param name="items">
		/// The AbsoluteTopicNameCollection whose elements are to be added to the end of this AbsoluteTopicNameCollection.
		/// </param>
		public virtual void AddRange(AbsoluteTopicNameCollection items)
		{
			foreach (AbsoluteTopicName item in items)
			{
				this.List.Add(item);
			}
		}
		/// <summary>
		/// Initializes a new instance of the AbsoluteTopicNameCollection class, containing elements
		/// copied from another instance of AbsoluteTopicNameCollection
		/// </summary>
		/// <param name="items">
		/// The AbsoluteTopicNameCollection whose elements are to be added to the new AbsoluteTopicNameCollection.
		/// </param>
		public AbsoluteTopicNameCollection(AbsoluteTopicNameCollection items)
		{
			this.AddRange(items);
		}
        public WireTypes.AbsoluteTopicNameCollection GetAllTopics(WireTypes.ContentBase cb)
        {
            WireTypes.AbsoluteTopicNameCollection topicNames = new WireTypes.AbsoluteTopicNameCollection();

            foreach (TopicName ab in Federation.NamespaceManagerForNamespace(cb.Namespace).AllTopics(ImportPolicy.DoNotIncludeImports))
            {
                // We need to also return the current version
                NamespaceManager contentStoreManager2 = Federation.NamespaceManagerForTopic(ab);
                WireTypes.AbsoluteTopicName atn = new WireTypes.AbsoluteTopicName();
                atn.Name = ab.LocalName;
                atn.Namespace = ab.Namespace;
                string version = contentStoreManager2.LatestVersionForTopic(ab.LocalName);
                if (version == null)
                {
                    // There's only one version, so just use the empty string
                    version = "";
                }
                atn.Version = version;
                topicNames.Add(atn);
            }

            return topicNames;
        }
			/// <summary>
			/// 
			/// </summary>
			/// <param name="collection"></param>
			public Enumerator(AbsoluteTopicNameCollection collection)
			{
				this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
			}
Пример #5
0
    public WireTypes.AbsoluteTopicNameCollection GetAllTopics(WireTypes.ContentBase cb)
    {
      WireTypes.AbsoluteTopicNameCollection topicNames = new WireTypes.AbsoluteTopicNameCollection();
			 
      foreach (AbsoluteTopicName ab in TheFederation.ContentBaseForNamespace(cb.Namespace).AllTopics(false))
      {
        // We need to also return the current version
        ContentBase cb2 = TheFederation.ContentBaseForTopic(ab); 
        WireTypes.AbsoluteTopicName atn = new WireTypes.AbsoluteTopicName();
        atn.Name = ab.Name;
        atn.Namespace = ab.Namespace; 
        string version = cb2.LatestVersionForTopic(ab.LocalName);
        if (version == null)
        {
          // There's only one version, so just use the empty string
          version = ""; 
        }
        atn.Version = version; 
        topicNames.Add(atn);
      }

      return topicNames;
    }