ESL Wire Plug-In Developer Guide Overview This Document Gives an Introduction to the Development of Plug-Ins for ESL Wire

Total Page:16

File Type:pdf, Size:1020Kb

ESL Wire Plug-In Developer Guide Overview This Document Gives an Introduction to the Development of Plug-Ins for ESL Wire ESL Wire Plug-in Developer Guide Overview This document gives an introduction to the development of plug-ins for ESL Wire. After explaining the plug-in basics, we give a step-by-step guide to programming your fist plug-in. However, this document only covers the first steps. An in-depth reference of the plug-in interface is available here. More information can be found on our ESL Wire Plug-in portal. What’s a plug-in? Plug-ins allow users to extend and customize ESL Wire according to their needs. A plug-in can integrate into the GUI (graphical user interface) of ESL Wire by adding an icon to the “plug-in bar” at the bottom of the main window. A plug-in is notified whenever a mouse click occurs on its icon, so it can react to mouse clicks by opening a window, showing a context menu, changing the icon or by some other action. The Plug-in bar of ESL Wire. The icon in the red circle was added by a plug-in. How do plug-ins work? Plug-ins for ESL Wire a are implemented as .Net class libraries. This means that a plug-in is a DLL file that is written in a programming language that uses the .Net Common Language Runtime (CLR) . This includes languages like C#, C++/CLI, VB.Net, Boo, Ruby.Net etc. Languages that use the Dynamic Language Runtime (DLR), on the other hand, are currently not supported. This includes IronPython, IronRuby. An overview of .Net languages can be found here. The DLL of a plug-in is not loaded directly into ESL Wire, but executed in a host-process, the so-called plug-in container. This way a faulty plug-in cannot affect the stability of ESL Wire or other plug-ins. Furthermore this allows you start, stop and restart your plug-in during development without having to restart ESL Wire. The plug-in container uses inter-process communication (IPC) to communicate with ESL Wire. This allows plug-ins to use functions of ESL Wire like normal, local functions. The IPC-system that is currently used for this, is D-Bus. The inter-process communication scheme for plug-ins. Multiple plug-in containers can communicate with ESL Wire via D-Bus. Where are the plug-ins? The plug-in DLLs are located in the “plugins” sub-directory of the ESL Wire installation directory. If you installed ESL Wire in “C:\Program Files\EslWire”, the plug-ins will be located in “C:\Program Files\EslWire\plugins”. ESL Wire tries to run all plug-ins that are found in this directory during start-up. However, as we will later explain, it is also possible to start a plug-in manually when ESL Wire is already running, which is useful for debugging a plug-in. How do I make a plug-in? The following paragraphs guide you step-by-step through the creation of a simple plug-in. The resulting plug-in will display an icon with tool tip text in ESL Wire and can be used as basis for developing more advanced plug-ins. What do I need? Obviously, first of all you need to have the latest version of ESL Wire installed to develop plug-ins (available at http://www.esl.eu/wire), at least version 1.7. There is no separate Plug-In SDK (Software Development Kit), since the necessary library is already included in the standard installation. A technical reference of the plug-in interface is available at http://dev.esl.eu/wire/plugin_api_reference/ Furthermore you will need a programming environment (IDE) that allows you to create a .Net class library. The following development environments have been successfully used for plug-in development: ● SharpDevelop (http://sharpdevelop.com/OpenSource/SD/Default.aspx) - A completely free and open source IDE that supports many CLR languages (C#, C++, VB.Net, Boo, etc.). If you are looking for a free development tool, this is our recommendation. ● Visual Studio Express Edition (http://www.microsoft.com/express/Windows/) - The free edition of Visual Studio. Unfortunately this edition does not support debugging of class libraries that are loaded by external application. Therefore we currently do not recommend the Express Edition. ● Visual Studio 2005 or 2008 - The commercial editions of Visual Studio are maybe the most complete and feature rich development environment for .Net, but also relatively expensive. ● Monodevelop (http://monodevelop.com/) - This open-source IDE was originally a port of SharpDevelop to Linux. Now it’s an independent project that is also available for Windows. Step by step Guide The following paragraphs walk you through the first steps towards developing you own plug-in. In this guide, we use C# and SharpDevelop 3.2. However, Visual Studio and Monodevelop have similar interfaces, and it should be possible to follow this guide with these programs as well. Step 1: Create a new class library project In the “File” menu, select “New” -> “Solution...”. In the “New Project” dialog, select the “C#” category and “Class Library” from the “Templates” list. Enter a name for your new project, e.g. MyFirstPlugin and click the “Create” button. Make sure you select “.Net Framework 3.0” or “.Net Framework 3.5” as the target framework. Plug-ins written for version 4.0 of the .Net Framework will not work! Step 2: Add necessary references Select “Add Reference” from the “Project” menu. In the GAC (Global Assembly Cache) tab, select the “System.Drawing” Reference, and click the “Select” button. In the “.Net Assembly Browser” tab of the “Add Reference” dialog, click the “Browse...” button. Navigate to the “pluginContainer” directory of your ESL Wire installation (typically “C:\Program Files\EslWire\pluginContainer”), select the file “PluginInterface.dll”, and click the “Open” button. Now close the “Add Reference” dialog by clicking the “OK” button. Step 3: Make your class inherit Wire.Plugin Now that you’ve added the PluginInterface reference, you can start editing your code. Add “: Wire.Plugin” to your class declaration to inherit the plug-in baseclass. Step 4: Override abstract members of Wire.Plugin The Wire.Plugin class has four abstract members you have to override: the string properties “Author”, “Version”, “Title” and the “init” method. When you have added overrides for these, you already have a working plug-in, albeit one with no functionality. Step 5: Embed an icon in your class library To add an existing icon file, select “Add” -> “Existing Item...” from the “Project” menu. Find an image file that is roughly 16x16 pixels in size. Supported image formats are PNG, JPEG, and BMP (For icons, the PNG format has the advantage that it supports alpha transparency). In this example, we added a file named “brick.png”. When asked “Do you want to copy the file(s) to the target directory...”, click the “Copy” button. An example icon can be found here. Now the image has to be embedded as a resource to the plug-in DLL. This is accomplished by setting the Build action field in the “Properties” view for the image file to “EmbeddedResource”. Step 6: Set the icon and tool tip In the “init” method of your plug-in, use the “setIcon” and “setTooltip” base class methods to define an icon with tooltip for your plug-in. Step 7: Build your plug-in Before compiling, you should change the project setting to support all CPU types (32-bit and 64-bit): Select “Project Options...” in the “Project” menu. On the “Compiling” tab, choose “Any processor” in the “Target CPU” field. Now, select “Build Solution” from the “Build” menu to compile your plug-in. You can copy the resulting DLL (MyFirstPlugin.dll) to the plugins\wire folder and restart ESL Wire to see your first plug-in in action. The icon of your plug-in should appear in the plug-in bar of the main window. How do I debug a plug-in? For any non-trivial plug in development, it will be necessary to debug your code. Fortunately this is easily done. Step 1: Change the debug settings of your project Go back to the project options (“Project” -> “Project Options...”), and open the “Debug” tab. Select the “Start external program” option and click the “...” button next to it. In the file dialog, select the “wire- plugin.exe” file in the “pluginContainer” directory of your ESL Wire installation. In the “Command line arguments” add the full path of your plug-in DLL in, enclosed in double quotes, e.g. "D:\SharpDevelop Projects\MyFirstPlugin\bin\Debug\MyFirstPlugin.dll". Step 2: Set a breakpoint To add a breakpoint in the first line of your “init” method, place the text cursor in the corresponding line and press the F7 button. Step 3: Start the debugger Make sure ESL Wire is running. Hit the F5 button to start the debugger. After a short while, the execution should pause at your break point. You can now step through each line by pressing F10. Adding more functionality To react to an event from ESL Wire, a plug-in only needs to add a handler method for a specific event. If you want your plug-in to do something whenever a game is started, just add the following code to the “init()” method: Wire.GameInterface gi = Wire.InterfaceFactory.gameInterface(); gi.GameStarted += new Wire.GameInterface.GameStartedHandler(gameStarted); For information about all available methods, please see the Wire plug-in reference: http://dev.esl.eu/wire/ plugin_api_reference/ The image below shows an example event handler. When you start a game it lists all by Wire detected games in the debug output. Another example is the following. It shows the name of the started game inside the debug output.
Recommended publications
  • Lap Around the .NET Framework 4
    Lap Around the .NET Framework 4 Marc Schweigert ([email protected]) Principal Developer Evangelist DPE US Federal Government Team http://blogs.msdn.com/devkeydet http://twitter.com/devkeydet .NET Framework 4.0 User Interface Services Data Access ASP.NET Windows Windows (WebForms, Entity Presentation Data Services Communication ADO.NET MVC, Dynamic Framework Foundation Foundation Data) Windows WinForms Workflow LINQ to SQL Foundation Core Managed Dynamic Parallel Base Class Extensibility LINQ Languages Language Extensions Library Framework Runtime Common Language Runtime ASP.NET MVC 1.0 (Model View Controller) A new Web Application Project type Simply an option Not a replacement for WebForms Builds on top ASP.NET Manual vs. Automatic Transmission Supports a clear separation of concerns Supports testability Supports “close to the metal” programming experience ASP.NET MVC 2 Visual Studio 2010 Included Visual Studio 2008 (Service Pack 1) Download Both versions built against .NET 3.5 What’s New in MVC 2? Better Separation of Concerns (Maintainability) Html.RenderAction() Areas Easier Validation (Maintainability/Productivity) Data Annotations Client Validation Helper Improvements (Maintainability/Productivity) Strongly-Typed Helpers Templated Helpers ASP.NET 4 Web Forms? Support for SEO with URL Routing Cleaner HTML Client ID improvements ViewState improvements Dynamic Data Improvements Chart Controls Productivity and Extensibility Rich Client Ajax supports both MVC & Web Forms WPF 4 Calendar, Data Grid, DatePicker Ribbon (separate download)
    [Show full text]
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Opening Presentation
    Mono Meeting. Miguel de Icaza [email protected] October 24, 2006 Mono, Novell and the Community. Mono would not exist without the community: • Individual contributors. • Companies using Mono. • Organizations using Mono. • Companies using parts of Mono. • Google Summer of Code. Introductions. 2 Goals of the Meeting. A chance to meet. • Most of the Novell/Mono team is here. • Many contributors are here. • Various breaks to talk. Talk to others! • Introduce yourself, ask questions. Talk to us! • Frank Rego, Mono's Product Manager is here. • Tell us what you need in Mono. • Tell us about how you use Mono. 3 Project Status Goals Originally: • Improve our development platform on Linux. As the community grew: • Expand to support Microsoft APIs. As Mono got more complete: • Provide a complete cross platform runtime. • Allow Windows developers to port to Linux. 5 Mono Stacks and Goals. MySMQySQLL//PPosstgtrgesrsess EvEovolluutitioonn# # ASP.NET Novell APIs: MMoozzillala Novell iFolder iFolder, LDAP, Identity ADO.NET ApAapchachee MMonoono DesktoGpTK#: GTK# OpNoevenlOl LfDfAiPce GCneomceil# Windows.Forms JavaJa vCa oCommpaatitbilbitiylity Google APIs Microsoft Compatibility Libraries Mono Libraries Mono Runtime (Implementation of ECMA #335) 6 Platforms, CIL, Code Generation. 7 API space Mono 1.0: July 2004 “T-Bone” Mono 1.2: November 2006 “Rump steak” Mono 1.2 bits. Reliability and C# 2.0, .NET 2.0 scalability: • Complete. • With VM support. • ZenWorks and iFolder • Some 2.0 API support. pushed Mono on the server. • IronPython works. • xsp 1.0: 8 request/second. • xsp 1.2: 250 Debugger: request/second. • x86 and x86-64 debugger. GUI • CLI-only, limited in scenarios (no xsp).
    [Show full text]
  • Visual Studio for Mono Development
    Visual Studio for Mono Development By Francisco “Paco” Martinez Overview ●Introduction ●Mono and Gtk# installers for Windows ●VSPrj2Make: An add-in for Visual Studio ●Distributing your Creation ●What's Next? ●Q&A Demo I Creating a quick Gtk# editor application using Visual Studio and Glade. Introduction ●Background Even if most of the coding and advances of Mono takes place on Linux, there are many Windows and .NET developers that may only have access to computers that run Windows and/or feel most comfortable developing in a Microsoft centric world. Another convincing argument for using the Visual Studio IDE is the benefits of its integrated debugger that permits step-by-step iterations anytime during the coding process. Introduction (continued) ●Prerequisites – The OS: Windows 2000 or Windows XP – Visual Studio .NET 2003 (standard ed. or better) – Gtk# Installer for .NET Framework SDK – VSPrj2Make Visual Studio Add-in – One or more versions of the Mono Combined Installer for Windows Introduction (continued) ●Other Useful Tools – Gtk# Windows Help for Visual Studio – MonoLaunch – GRE Installer for Gecko# – Inno Setup and InstallerMaker – Cygwin and/or Msys Mono and Gtk# Installers for Windows ●Mono Combined Installer for Windows – Does not require .NET SDK or Redistributable – Does not require Cygwin – Contains sufficient libraries (GNU, GTK+ and GNOME) to satisfy the managed libraries that bind to them. – Does not touch the Global PATH or other environment variables – this is key to permit coexistence of different versions on the same
    [Show full text]
  • Top 40 .NET Interview Questions & Answers
    https://career.guru99.com/ Guru99 Provides FREE ONLINE TUTORIAL on Various courses like Java | MIS | MongoDB | BigData | Cassandra | Web Services ------------------------------------------------------------------------------------------------------------------------------- SQLite | JSP | Informatica | Accounting | SAP Training | Python ------------------------------------------------------------------------------------------------------------------------------- Excel | ASP Net | HBase | Testing | Selenium | CCNA | NodeJS ------------------------------------------------------------------------------------------------------------------------------- TensorFlow | Data Warehouse | R Programming | Live Projects | DevOps ------------------------------------------------------------------------------------------------------------------------------- Top 40 .NET Interview Questions & Answers 1) Explain what is .NET Framework? The.Net Framework is developed by Microsoft. It provides technologies and tool that is required to build Networked Applications as well as Distributed Web Services and Web Applications. 2) What does .NET Framework provides? .NET Framework renders the necessary compile time and run time foundation to build and run any language that conforms to the Common Language Specification (CLS). 3) Mention what are main components of .Net framework? The main components of .Net framework are Common Language Runtime (CLR) .Net Framework Class Library (FCL) Application Domains Runtime Host Cross-Language Interoperability Side-by-Side Execution
    [Show full text]
  • Expression Trees 1 Dynamic Language Runtime Overview 5 Creating and Using Dynamic Objects 9 Early and Late Binding 17 Execute Ex
    Expression Trees 1 Dynamic Language Runtime Overview 5 Creating and Using Dynamic Objects 9 Early and Late Binding 17 Execute Expression Trees 19 Modify Expression Trees 21 Use Expression Trees to Build Dynamic Queries 23 Debugging Expression Trees 26 Expression Trees (Visual Basic) https://msdn.microsoft.com/en-us/library/mt654260(d=printer).aspx Expression Trees (Visual Basic) Visual Studio 2015 Expression trees represent code in a tree-like data structure, where each node is an expression, for example, a method call or a binary operation such as x < y . You can compile and run code represented by expression trees. This enables dynamic modification of executable code, the execution of LINQ queries in various databases, and the creation of dynamic queries. For more information about expression trees in LINQ, see How to: Use Expression Trees to Build Dynamic Queries (Visual Basic) . Expression trees are also used in the dynamic language runtime (DLR) to provide interoperability between dynamic languages and the .NET Framework and to enable compiler writers to emit expression trees instead of Microsoft intermediate language (MSIL). For more information about the DLR, see Dynamic Language Runtime Overview . You can have the C# or Visual Basic compiler create an expression tree for you based on an anonymous lambda expression, or you can create expression trees manually by using the System.Linq.Expressions namespace. Creating Expression Trees from Lambda Expressions When a lambda expression is assigned to a variable of type Expression(Of TDelegate) , the compiler emits code to build an expression tree that represents the lambda expression. The Visual Basic compiler can generate expression trees only from expression lambdas (or single-line lambdas).
    [Show full text]
  • Logview Studio Linux Preparation with Mono
    LogView Studio Linux Preparation with Mono 2014 by Dominik Schmidt [email protected] © 2014 Dominik Schmidt / Holger Hemmecke I LogView Studio Table of Contents Part I Linux Prepare 1 1 SSH Co..n..n..e..c..t. ........................................................................................................................ 1 2 Raspbe..r.r.y.. .P..i. ......................................................................................................................... 4 System Prepar..a..t.i.o...n.. ............................................................................................................................................... 5 Mono .......................................................................................................................................................... 6 Install Mono......................................................................................................................................................... 7 Compile Mon..o.. .f.r..o..m.. .T..A...R....................................................................................................................................... 8 Compile Mon..o.. .f.r..o..m.. .G...I.T........................................................................................................................................ 9 Testing ......................................................................................................................................................... 10 3 Cubie.t.r.u..c..k.. .........................................................................................................................
    [Show full text]
  • Moscow ML .Net Owner's Manual
    Moscow ML .Net Owner's Manual Version 0.9.0 of November 2003 Niels Jørgen Kokholm, IT University of Copenhagen, Denmark Peter Sestoft, Royal Veterinary and Agricultural University, Copenhagen, Denmark This document describes Moscow ML .Net 0.9.0, a port of Moscow ML 2.00 to the .Net platform. The focus is on how Moscow ML .Net differs from Moscow ML 2.0. Three other documents, the Moscow ML Owner’s Manual [7], the Moscow ML Language Overview [5] and the Moscow ML Library Documentation [6] describe general aspects of the Moscow ML system. Moscow ML implements Standard ML (SML), as defined in the 1997 Definition of Standard ML, including the SML Modules language and some extensions. Moreover, Moscow ML supports most re- quired parts of the SML Basis Library. It supports separate compilation and the generation of stand-alone executables. The reader is assumed to be familiar with the .Net platform [2]. Contents 1 Characteristics of Moscow ML .Net 2 1.1 Compiling and linking 2 1.2 Command-line options 3 1.3 Additional primitives in the built-in units 3 1.4 The libraries 4 2 Installation 5 3 External programming interface 5 3.1 How external assemblies are found and loaded 5 3.2 How to call a .Net static method from Moscow ML .Net. 6 3.2.1 An example 7 3.2.2 Passing arguments and using results 7 3.2.3 Representation of ML Values 8 3.2.4 Notes 8 3.2.5 An experimental auto-marshalling import mechanism: clr_val 8 3.3 How to call an ML function from .Net 10 3.3.1 Example 10 3.3.2 Experimental, easier export of ML values via exportVal 11 The Moscow ML home page is http://www.dina.kvl.dk/~sestoft/mosml.html 1 1 Characteristics of Moscow ML .Net Unlike most other ports of Moscow ML, this port is not based on porting the Caml Light runtime, but is based on the creation of a new backend that generates .Net CIL code.
    [Show full text]
  • Ironpython Und Die Dynamic Language Runtime (DLR) Softwareentwicklung Mit Python Auf Der Microsoft Windows Plattform
    IronPython und die Dynamic Language Runtime (DLR) Softwareentwicklung mit Python auf der Microsoft Windows Plattform Klaus Rohe ([email protected]) Microsoft Deutschland GmbH Einige Anmerkungen • Kein Python Tutorial: • Es werden einige Unterschiede von Python zu C# / Java dargestellt • Die Eigenschaften, Beispiele und Demos beziehen sich auf die Version IronPython 2.0 Beta 4. Die endgültig freigegebene Version von IronPython 2.0 kann andere Eigenschaften besitzen und sich anders verhalten. Herbstcampus 2008 – Titel des Vortrags 2 Agenda • Python • IronPython & die Dynamic Language Runtime • Benutzung von .NET Bibliotheken in IronPython • ADO.NET • WPF • Einbetten von IronPython in Applikationen • Interoperabilität • IronPython & Cpython • Interoperabilität CPython - .NET Herbstcampus 2008 – Titel des Vortrags 3 Historie von Python • Anfang der 1990er Jahre von Guido van Rossum am Zentrum für Mathematik und Informatik Amsterdam als Nachfolger für die Lehrsprache ABC entwickelt • Wurde ursprünglich für das verteilte Betriebssystem Amoeba entwickelt: http://www.cs.vu.nl/pub/amoeba/ • Der Name der Sprache bezieht sich auf die britische Komiker Gruppe Monty Python Herbstcampus 2008 – Titel des Vortrags 4 Charakterisierung von Python (1) • Python-Programm wird interpretiert • Unterstützt mehrere Programmierparadigmen: • Prozedural • Objektorientiert • Funktional • Klare, einfache Syntax • Portabel, verfügbar auf allen Plattformen mit C-Compiler • Windows, Mac OS, UNIX, LINUX, … • Leicht erweiterbar mit C/C++ Bibliotheken • Z. B. Bibliothek
    [Show full text]
  • A Multi-Programming-Language, Multi-Context Framework Designed for Computer Science Education Douglas Blank1, Jennifer S
    Bryn Mawr College Scholarship, Research, and Creative Work at Bryn Mawr College Computer Science Faculty Research and Computer Science Scholarship 2012 Calico: a multi-programming-language, multi- context framework designed for computer science education Doug Blank Bryn Mawr College, [email protected] Jennifer S. Kay James B. Marshall Keith O'Hara Mark Russo Let us know how access to this document benefits ouy . Follow this and additional works at: http://repository.brynmawr.edu/compsci_pubs Part of the Computer Sciences Commons Custom Citation Douglas Blank, Jennifer S. Kay, James B. Marshall, Keith O'Hara, and Mark Russo. Calico: A Multi-Programming-Language, Multi- Context Framework Designed for Computer Science Education. (2012). SIGCSE 2012 (Raleigh, NC). This paper is posted at Scholarship, Research, and Creative Work at Bryn Mawr College. http://repository.brynmawr.edu/compsci_pubs/53 For more information, please contact [email protected]. To appear in the Proceedings of the 43rd ACM Technical Symposium on Computer Science Education, SIGCSE 2012 Calico: A Multi-Programming-Language, Multi-Context Framework Designed for Computer Science Education Douglas Blank1, Jennifer S. Kay2, James B. Marshall3, Keith O'Hara4, and Mark Russo1 1Computer Science 2Computer Science 3Computer Science 4Computer Science Department Department Department Program Bryn Mawr College Rowan University Sarah Lawrence College Bard College Bryn Mawr, PA (USA) Glassboro, NJ (USA) Bronxville, NY (USA) Annandale-on-Hudson, NY (1) 610-526-6501 (1) 856-256-4593 (1) 914-395-2673 (1) 845-752-2359 [email protected] [email protected] [email protected] [email protected] ABSTRACT these contexts are often tied to a specific programming environ- The Calico project is a multi-language, multi-context program- ment, which limits their availability to only those willing to work ming framework and learning environment for computing educa- in that programming environment.
    [Show full text]
  • Working with Ironpython and WPF
    Working with IronPython and WPF Douglas Blank Bryn Mawr College Programming Paradigms Spring 2010 With thanks to: http://www.ironpython.info/ http://devhawk.net/ IronPython Demo with WPF >>> import clr >>> clr.AddReference("PresentationFramework") >>> from System.Windows import * >>> window = Window() >>> window.Title = "Hello" >>> window.Show() >>> button = Controls.Button() >>> button.Content = "Push Me" >>> panel = Controls.StackPanel() >>> window.Content = panel >>> panel.Children.Add(button) 0 >>> app = System.Windows.Application() >>> app.Run(window) XAML Example: Main.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestApp" Width="640" Height="480"> <StackPanel> <Label>Iron Python and WPF</Label> <ListBox Grid.Column="0" x:Name="listbox1" > <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Path=title}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Window> IronPython + XAML import sys if 'win' in sys.platform: import pythoncom pythoncom.CoInitialize() import clr clr.AddReference("System.Xml") clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") from System.IO import StringReader from System.Xml import XmlReader from System.Windows.Markup import XamlReader, XamlWriter from System.Windows import Window, Application xaml = """<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Title="XamlReader Example" Width="300" Height="200"> <StackPanel Margin="5"> <Button
    [Show full text]
  • The Microsoft Way: COM, OLE/Activex, COM+, and .NET CLR
    8557 Chapter 15 p329-380 8/10/02 12:24 pm Page 329 CHAPTER FIFTEEN The Microsoft way: COM, OLE/ActiveX, COM+, and .NET CLR In a sense, Microsoft is taking the easiest route. Instead of proposing a global standard and hoping to port its own systems to it, it continually re-engineers its existing application and platform base. Component technology is intro- duced gradually, gaining leverage from previous successes, such as the original Visual Basic controls (VBX – non-object-oriented components!), object link- ing and embedding (OLE), OLE database connectivity (ODBC), ActiveX, Microsoft Transaction Server (MTS), or active server pages (ASP). In the standards arena, Microsoft focuses mostly on internet (IETF) and web (W3C) standards. More recently, some of its .NET specifications (CLI and C#) where adopted by ECMA – a European standards body with a fast track to ISO (ECMA, 2001a, 2001b). Microsoft is not trying to align its approaches with OMG or Java standards. While Java figured prominently in Microsoft’s strategy for a while, it has been relegated to a mere continuation of support of its older Visual J++ product – in part as a result of a settlement between Sun and Microsoft. In addition, under the name Visual J# .NET, Microsoft offers a migration tool to .NET, primarily targeting users of Visual J++ 6.0. As part of the .NET initiative, Microsoft is promoting language neutrality as a major tenet of CLR and aims to establish a new language, C#. C# adopts many of the successful traits of Java, while adding several distinctive features of its own (such as value types) and not supporting key Java features (such as inner classes).
    [Show full text]