14. Using Yocto-Display with C#
C# (pronounced C-Sharp) is an object-oriented programming language promoted by Microsoft, it is
somewhat similar to Java. Like Visual-Basic and Delphi, it allows you to create Windows applications
quite easily. All the examples and the project models are tested with Microsoft C# 2010 Express,
freely available on the Microsoft web site
1
.
Our programming library is also compatible with
Mono
, the open source version of C# that also works
on Linux and MacOS. You will find on our web site various articles that describe how to configure
Mono to use our library.
14.1. Installation
Download the Visual C# Yoctopuce library from the Yoctopuce web site
2
. There is no setup program,
simply copy the content of the zip file into the directory of your choice. You mostly need the content
of the
Sources
directory. The other directories contain the documentation and a few sample
programs. All sample projects are Visual C# 2010, projects, if you are using a previous version, you
may have to recreate the projects structure from scratch.
14.2. Using the Yoctopuce API in a Visual C# project
The Visual C#.NET Yoctopuce library is composed of a DLL and of source files in Visual C#. The
DLL is not a .NET DLL, but a classic DLL, written in C, which manages the low level communications
with the modules
3
. The source files in Visual C# manage the high level part of the API. Therefore,
your need both this DLL and the .cs files of the
sources
directory to create a project managing
Yoctopuce modules.
Configuring a Visual C# project
The following indications are provided for Visual Studio Express 2010, but the process is similar for
other versions. Start by creating your project. Then, on the
Solution Explorer
panel, right click on your
project, and select "Add" and then "Add an existing item".
A file selection window opens. Select the
yocto_api.cs
file and the files corresponding to the
functions of the Yoctopuce modules that your project is going to manage. If in doubt, select all the
files.
1
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express
2
www.yoctopuce.com/EN/libraries.php
3
The sources of this DLL are available in the C++ API
www.yoctopuce.com
79
Содержание Yocto-Display
Страница 1: ...Yocto Display User Manual...
Страница 2: ......
Страница 40: ...34 www yoctopuce com...
Страница 52: ...46 www yoctopuce com...
Страница 84: ...78 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...22 High level API Reference 152 www yoctopuce com On failure throws an exception or returns a negative error code...
Страница 422: ...416 www yoctopuce com...
Страница 424: ...24 Characteristics 418 www yoctopuce com...