Introduction
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.
Project Requirements
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 SearchCommand
on StockChartAutoComplete
example.

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 YahooDailyMarketData
.
On 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.
Generated Code
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.
StockChartAutoComplete
(Director)->Build->Debug->Scripts->ProgramScript
->MainWindows.cs
- Set break point at the beginning of function
GetKeyInText
. - At Microsoft Visual Studio
Debug->Attach to Process…
to attach the running program StockChartAutoComplete
- On
StockChartAutoComplete
execution window, type a character at Stock
textbox.

The Microsoft Visual Studio should break at GetKeyInText
function.
Start Debugger at Program Startup
On StockChartAutoComplete
project, the Log.xsml object instance is created at program startup.
Open StockChartAutoComplete
project and open(double click) Application.moddc. You can see the following line:
<PreloadObject Path="Schema\Log.xsml" />
The 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
Using Panel
using System;
using System.Diagnostics;
Code Panel
static public void StartDebugger()
{
Debugger.Launch();
}
Connect controls as follows:

Run 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
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.