1 | using System;
|
---|
2 | using System.Xml;
|
---|
3 |
|
---|
4 | using SharpVectors.Dom.Events;
|
---|
5 |
|
---|
6 | namespace SharpVectors.Dom
|
---|
7 | {
|
---|
8 | /// <summary>
|
---|
9 | /// Summary description for DocumentFragment.
|
---|
10 | /// </summary>
|
---|
11 | public class DocumentFragment
|
---|
12 | : XmlDocumentFragment
|
---|
13 | , INode
|
---|
14 | , IEventTargetSupport
|
---|
15 | {
|
---|
16 | #region Private Fields
|
---|
17 |
|
---|
18 | private EventTarget eventTarget;
|
---|
19 |
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | #region Constructors
|
---|
23 |
|
---|
24 | protected internal DocumentFragment(
|
---|
25 | Document document)
|
---|
26 | : base(document)
|
---|
27 | {
|
---|
28 | eventTarget = new EventTarget(this);
|
---|
29 | }
|
---|
30 |
|
---|
31 | #endregion
|
---|
32 |
|
---|
33 | #region IEventTarget interface
|
---|
34 |
|
---|
35 | #region Methods
|
---|
36 |
|
---|
37 | #region DOM Level 2
|
---|
38 |
|
---|
39 | void IEventTarget.AddEventListener(
|
---|
40 | string type,
|
---|
41 | EventListener listener,
|
---|
42 | bool useCapture)
|
---|
43 | {
|
---|
44 | eventTarget.AddEventListener(type, listener, useCapture);
|
---|
45 | }
|
---|
46 |
|
---|
47 | void IEventTarget.RemoveEventListener(
|
---|
48 | string type,
|
---|
49 | EventListener listener,
|
---|
50 | bool useCapture)
|
---|
51 | {
|
---|
52 | eventTarget.RemoveEventListener(type, listener, useCapture);
|
---|
53 | }
|
---|
54 |
|
---|
55 | bool IEventTarget.DispatchEvent(
|
---|
56 | IEvent @event)
|
---|
57 | {
|
---|
58 | return eventTarget.DispatchEvent(@event);
|
---|
59 | }
|
---|
60 |
|
---|
61 | #endregion
|
---|
62 |
|
---|
63 | #region DOM Level 3 Experimental
|
---|
64 |
|
---|
65 | void IEventTarget.AddEventListenerNs(
|
---|
66 | string namespaceUri,
|
---|
67 | string type,
|
---|
68 | EventListener listener,
|
---|
69 | bool useCapture,
|
---|
70 | object eventGroup)
|
---|
71 | {
|
---|
72 | eventTarget.AddEventListenerNs(namespaceUri, type, listener, useCapture, eventGroup);
|
---|
73 | }
|
---|
74 |
|
---|
75 | void IEventTarget.RemoveEventListenerNs(
|
---|
76 | string namespaceUri,
|
---|
77 | string type,
|
---|
78 | EventListener listener,
|
---|
79 | bool useCapture)
|
---|
80 | {
|
---|
81 | eventTarget.RemoveEventListenerNs(namespaceUri, type, listener, useCapture);
|
---|
82 | }
|
---|
83 |
|
---|
84 | bool IEventTarget.WillTriggerNs(
|
---|
85 | string namespaceUri,
|
---|
86 | string type)
|
---|
87 | {
|
---|
88 | return eventTarget.WillTriggerNs(namespaceUri, type);
|
---|
89 | }
|
---|
90 |
|
---|
91 | bool IEventTarget.HasEventListenerNs(
|
---|
92 | string namespaceUri,
|
---|
93 | string type)
|
---|
94 | {
|
---|
95 | return eventTarget.HasEventListenerNs(namespaceUri, type);
|
---|
96 | }
|
---|
97 |
|
---|
98 | #endregion
|
---|
99 |
|
---|
100 | #endregion
|
---|
101 |
|
---|
102 | #endregion
|
---|
103 |
|
---|
104 | #region NON-DOM
|
---|
105 |
|
---|
106 | void IEventTargetSupport.FireEvent(
|
---|
107 | IEvent @event)
|
---|
108 | {
|
---|
109 | eventTarget.FireEvent(@event);
|
---|
110 | }
|
---|
111 |
|
---|
112 | #endregion
|
---|
113 | }
|
---|
114 | }
|
---|