コード例 #1
0
 public static void SetQuirksMode(this DomDocument self, QuirksMode value)
 {
     self.RemoveAnnotations <QuirksModeAnnotation>();
     if (value != QuirksMode.None)
     {
         self.AddAnnotation(new QuirksModeAnnotation(value));
     }
 }
コード例 #2
0
 public void test_add_annotation_nominal()
 {
     DomDocument d = new DomDocument();
     d.AddAnnotation(DBNull.Value);
     Assert.True(d.HasAnnotation<DBNull>());
     Assert.That(d.Annotations<DBNull>(), Is.Not.Empty);
     Assert.That(d.Annotations<Uri>(), Is.Empty);
     Assert.That(d.Annotation<DBNull>(), Is.EqualTo(DBNull.Value));
 }
コード例 #3
0
        public void AddAnnotation_nominal()
        {
            DomDocument d = new DomDocument();

            d.AddAnnotation(AnnotationClass.Value);

            Assert.True(d.HasAnnotation <AnnotationClass>());
            Assert.NotEmpty(d.Annotations <AnnotationClass>());
            Assert.Empty(d.Annotations <Uri>());
            Assert.Equal(AnnotationClass.Value, d.Annotation <AnnotationClass>());
        }