Crosslight provides various samples to help you quickly getting started with the basic concepts, capabilities and features available in Crosslight. All Crosslight samples are now available online and can be downloaded from Intersoft Git server.
This page provides in-depth guides to configure and work with Crosslight samples through the following sections:
Getting Started with Crosslight Samples
Starting from Crosslight 2, all samples are now available online which can be downloaded directly from Intersoft Git server. The shifting to the online repo enables Crosslight product team to make changes and push new samples in agile fashion. As the results, you can obtain new sample updates faster without the hassles of re-installation.
There are two ways to obtain Crosslight samples depending on your preferences. If you have git installed, you can quickly clone the samples repo through the git command line or GUI. Otherwise, you can visit the Intersoft Git web interface and download the samples as a single zip file.
Download from Intersoft Git Server
To download the samples from Intersoft Git web interface, simply open your browser and point to this address: http://git.intersoftpt.com/projects/CROS/repos/samples/browse. Click the Download button such as shown in the following screenshot to start downloading the entire repo in a single zip file.
For quick setup, it is recommended that you extracted the zip file to the samples folder in the Crosslight installation. The samples folder is located in:
- Mac – /Library/Application Support/Intersoft Solutions/Crosslight 2/samples
- Windows – [Program Files]\Intersoft Solutions\Crosslight\Crosslight 2\samples
Clone Crosslight Samples Repo
If you already used Git in your development, you may prefer to use the Git command line to check out the entire repo.
First, open the terminal/command prompt and change the working folder to root Crosslight installation folder. The installation folder is located in:
- Mac – /Library/Application Support/Intersoft Solutions/Crosslight 2
- Windows – [Program Files]\Intersoft Solutions\Crosslight 2
Type the following command to get the files from the online repo and automatically place them in the samples folder of the installation folder.
In addition to command line, you can also clone from the Git web interface. It works best when you use SourceTree as your primary Git client.
The following screenshot shows how to clone a repo from the Intersoft Git.
When you clicked the Clone in SourceTree button, the SourceTree app will automatically appear with the new repository configuration dialog.
Once the repo is cloned to your local working folder, you can start exploring the available samples.
Configuring WebAPI-enabled Crosslight Samples
In addition to simple samples, Crosslight also provides samples that utilizes REST operations via WebAPI servers. Currently, you will need to have separate Windows machines to run the WebAPI servers to run the samples (if you only own a Mac). You will the run the WebAPI server on the Windows machine, then run the simulators/devices with the IP address pointing to the WebAPI server to perform various data operations.
After you have successfully opened up the WebAPI-enabled samples in Visual Studio, you will need to configure the IISExpress's applicationhost.config in order for your devices/emulators to be able to access the server. To do this, open up My Documents/IISExpress/config/applicationhost.config file.
Scroll down until you find the sample's WebAPI configuration. You will need to add a new binding with the * sign so that it can accept any requests coming not just from "localhost".
Save the file, then close it. You may need to restart Visual Studio and re-open the solution for the config to take effect. Then run the WebAPI project. You should now be able to run the WebAPI server. To test this, try connecting to your own IP and hit the WebAPI server. To find your IP, run Command Prompt and type in ipconfig.
The next step is to change the AppService.cs file contained in the Infrastructure folder of the Core project. You will need to change the AppSettings to the WebAPI server you have just successfully configured.
Now you're ready to run the WebAPI samples using device/simulators.
Please refer to the following links to learn more about Crosslight samples.
There is no content with the specified labels