Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 1 and Version 2 of SandBox

Show
Ignore:
Author:
John (IP: 86.133.234.35)
Timestamp:
05/16/06 20:08:33 (18 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SandBox

    v1 v2  
    44 
    55Go ahead, edit it freely. 
     6 
     7{{{ 
     8#!html 
     9<h1 style="font-family: Tahoma, Verdana, sans-serif; font-size: 19pt; font-weight: normal">The Juno Project</h1> 
     10<h2 style="font-family: Georgia, Times New Roman, serif; font-size: 14pt; font-weight: normal">Introduction</h2> 
     11<p style="font-family: Arial, Verdana, sans-serif; font-size: 11pt; font-weight: bold">Juno is a general-purpose class library for the D programming language. It aims to offer the kind of power and ease-of-use enjoyed on platforms such as .NET and Java to D developers.</p> 
     12<p style="font-family: Arial, Verdana, sans-serif; font-size: 11pt">Juno compiles only on Windows and is distributed under the BSD licence.</p> 
     13<p style="font-family: Arial, Verdana, sans-serif; font-size: 11pt">More details, documentation and downloads will be coming soon. In the meantime, here's Juno in action, loading an XML document and getting notified when it's loaded.</p> 
     14}}} 
     15{{{ 
     16#!d 
     17import juno.base.all, 
     18  juno.xml.msxml; 
     19 
     20void main() { 
     21  // Create an instance of IXMLDOMDocument3. 
     22  using (XMLDOMDocument60.createInstance!(IXMLDOMDocument3), delegate(IXMLDOMDocument3 doc) { 
     23 
     24    // Create an event provider. 
     25    alias EventProvider!(XMLDOMDocumentEvents) Events; 
     26    using (new Events(doc), delegate(Events e) { 
     27 
     28      // Attach an event handler for doc's onReadyStateChange event. 
     29      alias EventProvider!(XMLDOMDocumentEvents) Events; 
     30      e.bind("onReadyStateChange", delegate { 
     31        writefln("state changed"); 
     32        int readyState; 
     33        doc.get_readyState(readyState); 
     34        // Do something once the document has fully loaded. 
     35        if (readyState == 4) 
     36          writefln("document complete."); 
     37      }); 
     38 
     39      // Tell the document to load asynchronously. 
     40      doc.set_aync(com_true); 
     41      // Load the XML document. 
     42      com_bool result; 
     43      doc.load("books.xml".toVariant(), result); 
     44 
     45    }); // e is automatically released at the end of the scope. 
     46 
     47  }); // doc is automatically released 
     48} 
     49}}}