[12762] | 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 ProcessingInstruction.
|
---|
| 10 | /// </summary>
|
---|
| 11 | public class ProcessingInstruction
|
---|
| 12 | : XmlProcessingInstruction
|
---|
| 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 ProcessingInstruction(
|
---|
| 25 | string target,
|
---|
| 26 | string data,
|
---|
| 27 | Document document)
|
---|
| 28 | : base(target, data, document)
|
---|
| 29 | {
|
---|
| 30 | eventTarget = new EventTarget(this);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | #endregion
|
---|
| 34 |
|
---|
| 35 | #region IEventTarget interface
|
---|
| 36 |
|
---|
| 37 | #region Methods
|
---|
| 38 |
|
---|
| 39 | #region DOM Level 2
|
---|
| 40 |
|
---|
| 41 | void IEventTarget.AddEventListener(
|
---|
| 42 | string type,
|
---|
| 43 | EventListener listener,
|
---|
| 44 | bool useCapture)
|
---|
| 45 | {
|
---|
| 46 | eventTarget.AddEventListener(type, listener, useCapture);
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | void IEventTarget.RemoveEventListener(
|
---|
| 50 | string type,
|
---|
| 51 | EventListener listener,
|
---|
| 52 | bool useCapture)
|
---|
| 53 | {
|
---|
| 54 | eventTarget.RemoveEventListener(type, listener, useCapture);
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | bool IEventTarget.DispatchEvent(
|
---|
| 58 | IEvent @event)
|
---|
| 59 | {
|
---|
| 60 | return eventTarget.DispatchEvent(@event);
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | #endregion
|
---|
| 64 |
|
---|
| 65 | #region DOM Level 3 Experimental
|
---|
| 66 |
|
---|
| 67 | void IEventTarget.AddEventListenerNs(
|
---|
| 68 | string namespaceUri,
|
---|
| 69 | string type,
|
---|
| 70 | EventListener listener,
|
---|
| 71 | bool useCapture,
|
---|
| 72 | object eventGroup)
|
---|
| 73 | {
|
---|
| 74 | eventTarget.AddEventListenerNs(namespaceUri, type, listener, useCapture, eventGroup);
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | void IEventTarget.RemoveEventListenerNs(
|
---|
| 78 | string namespaceUri,
|
---|
| 79 | string type,
|
---|
| 80 | EventListener listener,
|
---|
| 81 | bool useCapture)
|
---|
| 82 | {
|
---|
| 83 | eventTarget.RemoveEventListenerNs(namespaceUri, type, listener, useCapture);
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | bool IEventTarget.WillTriggerNs(
|
---|
| 87 | string namespaceUri,
|
---|
| 88 | string type)
|
---|
| 89 | {
|
---|
| 90 | return eventTarget.WillTriggerNs(namespaceUri, type);
|
---|
| 91 | }
|
---|
| 92 |
|
---|
| 93 | bool IEventTarget.HasEventListenerNs(
|
---|
| 94 | string namespaceUri,
|
---|
| 95 | string type)
|
---|
| 96 | {
|
---|
| 97 | return eventTarget.HasEventListenerNs(namespaceUri, type);
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | #endregion
|
---|
| 101 |
|
---|
| 102 | #endregion
|
---|
| 103 |
|
---|
| 104 | #endregion
|
---|
| 105 |
|
---|
| 106 | #region NON-DOM
|
---|
| 107 |
|
---|
| 108 | void IEventTargetSupport.FireEvent(
|
---|
| 109 | IEvent @event)
|
---|
| 110 | {
|
---|
| 111 | eventTarget.FireEvent(@event);
|
---|
| 112 | }
|
---|
| 113 |
|
---|
| 114 | #endregion
|
---|
| 115 | }
|
---|
| 116 | }
|
---|