Example #1
0
 /// <summary>
 /// Removes the first occurrence of a specific RsdApi from this RsdApiCollection.
 /// </summary>
 /// <param name="value">
 /// The RsdApi value to remove from this RsdApiCollection.
 /// </param>
 public virtual void Remove(RsdApi value)
 {
     this.List.Remove(value);
 }
        public RsdRoot GetRsd()
        {
            // TODO: NLS - Make the default API configurable through SiteConfig
            SiteConfig siteConfig = SiteConfig.GetSiteConfig();
            RsdApiCollection apiCollection = new RsdApiCollection();

            RsdRoot rsd = new RsdRoot();
            RsdService dasBlogService = new RsdService();
            dasBlogService.HomePageLink = SiteUtilities.GetBaseUrl(siteConfig);

            RsdApi metaWeblog    = new RsdApi();
            metaWeblog.Name      = "MetaWeblog";
            metaWeblog.Preferred = ( siteConfig.PreferredBloggingAPI == metaWeblog.Name );
            metaWeblog.ApiLink   = SiteUtilities.GetBloggerUrl(siteConfig);
            metaWeblog.BlogID    = dasBlogService.HomePageLink;
            apiCollection.Add(metaWeblog);

            RsdApi blogger    = new RsdApi();
            blogger.Name      = "Blogger";
            blogger.Preferred = ( siteConfig.PreferredBloggingAPI == blogger.Name );
            blogger.ApiLink   = SiteUtilities.GetBloggerUrl(siteConfig);
            blogger.BlogID    = dasBlogService.HomePageLink;
            apiCollection.Add(blogger);

            RsdApi moveableType    = new RsdApi();
            moveableType.Name      = "Moveable Type";
            moveableType.Preferred = ( siteConfig.PreferredBloggingAPI == moveableType.Name );
            moveableType.ApiLink   = SiteUtilities.GetBloggerUrl( siteConfig );
            moveableType.BlogID    = dasBlogService.HomePageLink;
            apiCollection.Add( moveableType );

            dasBlogService.RsdApiCollection = apiCollection;
            rsd.Services.Add(dasBlogService);

            return rsd;
        }
Example #3
0
 /// <summary>
 /// Return the zero-based index of the first occurrence of a specific value
 /// in this RsdApiCollection
 /// </summary>
 /// <param name="value">
 /// The RsdApi value to locate in the RsdApiCollection.
 /// </param>
 /// <returns>
 /// The zero-based index of the first occurrence of the _ELEMENT value if found;
 /// -1 otherwise.
 /// </returns>
 public virtual int IndexOf(RsdApi value)
 {
     return(this.List.IndexOf(value));
 }
Example #4
0
 /// <summary>
 /// Inserts an element into the RsdApiCollection at the specified index
 /// </summary>
 /// <param name="index">
 /// The index at which the RsdApi is to be inserted.
 /// </param>
 /// <param name="value">
 /// The RsdApi to insert.
 /// </param>
 public virtual void Insert(int index, RsdApi value)
 {
     this.List.Insert(index, value);
 }
Example #5
0
 /// <summary>
 /// Adds an instance of type RsdApi to the end of this RsdApiCollection.
 /// </summary>
 /// <param name="value">
 /// The RsdApi to be added to the end of this RsdApiCollection.
 /// </param>
 public virtual void Add(RsdApi value)
 {
     this.List.Add(value);
 }
Example #6
0
 /// <summary>
 /// Determines whether a specfic RsdApi value is in this RsdApiCollection.
 /// </summary>
 /// <param name="value">
 /// The RsdApi value to locate in this RsdApiCollection.
 /// </param>
 /// <returns>
 /// true if value is found in this RsdApiCollection;
 /// false otherwise.
 /// </returns>
 public virtual bool Contains(RsdApi value)
 {
     return(this.List.Contains(value));
 }
Example #7
0
 /// <summary>
 /// Inserts an element into the RsdApiCollection at the specified index
 /// </summary>
 /// <param name="index">
 /// The index at which the RsdApi is to be inserted.
 /// </param>
 /// <param name="value">
 /// The RsdApi to insert.
 /// </param>
 public virtual void Insert(int index, RsdApi value)
 {
     this.List.Insert(index, value);
 }
Example #8
0
 /// <summary>
 /// Removes the first occurrence of a specific RsdApi from this RsdApiCollection.
 /// </summary>
 /// <param name="value">
 /// The RsdApi value to remove from this RsdApiCollection.
 /// </param>
 public virtual void Remove(RsdApi value)
 {
     this.List.Remove(value);
 }
Example #9
0
 /// <summary>
 /// Return the zero-based index of the first occurrence of a specific value
 /// in this RsdApiCollection
 /// </summary>
 /// <param name="value">
 /// The RsdApi value to locate in the RsdApiCollection.
 /// </param>
 /// <returns>
 /// The zero-based index of the first occurrence of the _ELEMENT value if found;
 /// -1 otherwise.
 /// </returns>
 public virtual int IndexOf(RsdApi value)
 {
     return this.List.IndexOf(value);
 }
Example #10
0
 /// <summary>
 /// Determines whether a specfic RsdApi value is in this RsdApiCollection.
 /// </summary>
 /// <param name="value">
 /// The RsdApi value to locate in this RsdApiCollection.
 /// </param>
 /// <returns>
 /// true if value is found in this RsdApiCollection;
 /// false otherwise.
 /// </returns>
 public virtual bool Contains(RsdApi value)
 {
     return this.List.Contains(value);
 }
Example #11
0
 /// <summary>
 /// Adds an instance of type RsdApi to the end of this RsdApiCollection.
 /// </summary>
 /// <param name="value">
 /// The RsdApi to be added to the end of this RsdApiCollection.
 /// </param>
 public virtual void Add(RsdApi value)
 {
     this.List.Add(value);
 }
Example #12
0
 /// <summary>
 /// Adds the elements of an array to the end of this RsdApiCollection.
 /// </summary>
 /// <param name="items">
 /// The array whose elements are to be added to the end of this RsdApiCollection.
 /// </param>
 public virtual void AddRange(RsdApi[] items)
 {
     foreach (RsdApi item in items)
     {
         this.List.Add(item);
     }
 }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the RsdApiCollection class, containing elements
 /// copied from an array.
 /// </summary>
 /// <param name="items">
 /// The array whose elements are to be added to the new RsdApiCollection.
 /// </param>
 public RsdApiCollection(RsdApi[] items)
 {
     this.AddRange(items);
 }