Beispiel #1
0
        protected void OnNewEventExtensionElement(object sender,
                                                  ExtensionElementEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }
            if (e.DiscardEntry)
            {
                return;
            }

            if (String.Compare(e.ExtensionElement.NamespaceURI,
                               GBaseNameTable.NSGBase, true) == 0)
            {
                e.DiscardEntry = true;

                if (e.Base is GBaseAttributeContainer)
                {
                    GBaseAttributeContainer container = e.Base as GBaseAttributeContainer;
                    container.GBaseAttributes.AddFromXml(e.ExtensionElement);
                    return;
                }
            }

            if (e.Base is GBaseEntry)
            {
                GBaseEntry entry = e.Base as GBaseEntry;

                if (entry.AddFromMetaNamespace(e.ExtensionElement))
                {
                    e.DiscardEntry = true;
                }
            }
        }
        public void testGetSetAttributeHistogram()
        {
            AttributeHistogram xHistogram = new AttributeHistogram("x",
                                            GBaseAttributeType.Int,
                                            2);
            AttributeHistogram yHistogram = new AttributeHistogram("x",
                                            GBaseAttributeType.Int,
                                            2);
            GBaseEntry entry = new GBaseEntry();
            Assert.IsNull(entry.AttributeHistogram);

            entry.AttributeHistogram = xHistogram;

            Assert.AreEqual(xHistogram, entry.AttributeHistogram);

            entry.AttributeHistogram = yHistogram;

            Assert.AreEqual(yHistogram, entry.AttributeHistogram);

            entry.AttributeHistogram = null;

            Assert.AreEqual(null, entry.AttributeHistogram);
        }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Inserts an entry into a feed.</summary>
 /// <param name="feedUri">the Uri of a feed, usually created
 /// by <see cref="GBaseUriFactory"/></param>
 /// <param name="entry">the entry to add to the feed</param>
 /// <returns>the same entry, with a new id, as it has been added
 /// into the feed</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseEntry Insert(Uri feedUri, GBaseEntry entry)
 {
     entry.GBaseAttributes.Application = applicationName;
     return base.Insert(feedUri, entry) as GBaseEntry;
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Inserts an entry into a feed.</summary>
 /// <param name="feed">a feed object you got from a previous
 /// query</param>
 /// <param name="entry">the entry to add to the feed</param>
 /// <returns>the same entry, with a new id, as it has been added
 /// into the feed</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseEntry Insert(GBaseFeed feed, GBaseEntry entry)
 {
     entry.GBaseAttributes.Application = applicationName;
     return base.Insert((AtomFeed)feed, (AtomEntry)entry) as GBaseEntry;
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Updates an entry</summary>
 /// <param name="entry">An entry with a valid id and content</param>
 /// <returns>the entry as it has been updated and returned by the
 /// server.</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseEntry Update(GBaseEntry entry)
 {
     entry.GBaseAttributes.Application = applicationName;
     return base.Update((AtomEntry)entry) as GBaseEntry;
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Inserts an entry into a feed.</summary>
 /// <param name="feedUri">the Uri of a feed, usually created
 /// by <see cref="GBaseUriFactory"/></param>
 /// <param name="entry">the entry to add to the feed</param>
 /// <returns>the same entry, with a new id, as it has been added
 /// into the feed</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseEntry Insert(Uri feedUri, GBaseEntry entry)
 {
     entry.GBaseAttributes.Application = applicationName;
     return(base.Insert(feedUri, entry) as GBaseEntry);
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Inserts an entry into a feed.</summary>
 /// <param name="feed">a feed object you got from a previous
 /// query</param>
 /// <param name="entry">the entry to add to the feed</param>
 /// <returns>the same entry, with a new id, as it has been added
 /// into the feed</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseEntry Insert(GBaseFeed feed, GBaseEntry entry)
 {
     entry.GBaseAttributes.Application = applicationName;
     return(base.Insert((AtomFeed)feed, (AtomEntry)entry) as GBaseEntry);
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Updates an entry</summary>
 /// <param name="entry">An entry with a valid id and content</param>
 /// <returns>the entry as it has been updated and returned by the
 /// server.</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseEntry Update(GBaseEntry entry)
 {
     entry.GBaseAttributes.Application = applicationName;
     return(base.Update((AtomEntry)entry) as GBaseEntry);
 }