In modds Drag and Drop Programming for C# Sample Stock Chart Auto Completion (part 3), I show an example of adding auto completion to Stock Chart Program. As the program gets more complicated, we need ways to debug and step into the codes.
Debugging the modds Project
Simple Pop Up Windows
With modds Designer, you can use
Inspection Tools->ToStringMessageBox at Control Toolbox panel to check if a control receives data or not.
Example: Connect a Message Box to
In this example, the black line's connection index is set to
0 and the blue line's connection index is set to
1. This means the data will flow to
Message Box first before it flows to
StockChartAutoComplete program UI, the search button is data binded to
SearchCommand control. When user presses the search button, the Message Box will pop up. The Message Box will stop the data flow until user presses the OK button in it. This is the simplest way to see if you have a data flow on connected control.
When modds program compiled in DEBUG mode, all code written with Scripts->C# Script control will generate a .cs file. Those files are located at Project Director-> Build->Debug->Scripts->ProgramScript-><Module filename.cs>.
You can use Microsoft Visual Studio to open the .cs file and set break point on it.
Step In To the Generated Code
- Using modds Designer to open
StockChartAutoComplete example project.
- Right click on the project and select
Debug to run.
- Using Microsoft Visual Studio to open the following .cs file.
- Set break point at the beginning of function
- At Microsoft Visual Studio
Debug->Attach to Process… to attach the running program
StockChartAutoComplete execution window, type a character at
The Microsoft Visual Studio should break at
Start Debugger at Program Startup
StockChartAutoComplete project, the Log.xsml object instance is created at program startup.
StockChartAutoComplete project and open(double click) Application.moddc. You can see the following line:
<PreloadObject Path="Schema\Log.xsml" />
PreloadObject line tells modds object builder to create the path module object before creating the MAIN object. In this example, the Log.xsml is created before the MAIN (MainWindow.xsml). We can launch the Microsoft Debugger at Log.xsml.
- Open Log.xsml
- On Control Toolbox panel, drag in modds Common Controls->Start Trigger
- On Control Toolbox panel, drag in Scripts->C# Script and enter the following code
static public void StartDebugger()
Connect controls as follows:
StockChartAutoComplete in Debug, the Microsoft Visual Studio will start and attach to the running program.
modds Drag and Drop Programming for C# Creating Class Library (DLL) - Part 5