|
Revision 179, 0.6 kB
(checked in by John, 4 years ago)
|
added examples
|
| Line | |
|---|
| 1 |
module juno.examples.com.events; |
|---|
| 2 |
|
|---|
| 3 |
import juno.com.core, juno.com.client; |
|---|
| 4 |
import std.stdio : writefln; |
|---|
| 5 |
|
|---|
| 6 |
void main() { |
|---|
| 7 |
auto doc = DOMDocument60.coCreate!(IXMLDOMDocument3); |
|---|
| 8 |
scope(exit) tryRelease(doc); |
|---|
| 9 |
|
|---|
| 10 |
auto events = new EventProvider!(XMLDOMDocumentEvents)(doc); |
|---|
| 11 |
scope(exit) tryRelease(events); |
|---|
| 12 |
|
|---|
| 13 |
events.bind("onReadyStateChange", { |
|---|
| 14 |
writefln("stage changed"); |
|---|
| 15 |
}); |
|---|
| 16 |
events.bind("onDataAvailable", { |
|---|
| 17 |
writefln("data available"); |
|---|
| 18 |
}); |
|---|
| 19 |
|
|---|
| 20 |
doc.put_async(com_true); |
|---|
| 21 |
|
|---|
| 22 |
com_bool result; |
|---|
| 23 |
doc.load("test.xml".toVariant(true), result); |
|---|
| 24 |
} |
|---|