I need help getting to solve a compile error in C# using MS's MSBNx
COM. I am using Visual Studio 2003 and C# 2005 Express. My goal is to
manually add nodes to a MSBN3Lib.Model. I am able to load an existing
file successfully with this method.
<code>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MSBN3Lib;
.......
private void button1_Click(object sender, EventArgs e)
{
MSBN3Lib.MSBN aMSBN = new MSBN3Lib.MSBN();
MSBN3Lib.Model model1 = aMSBN.Models.Add("Auto",
@"C:\Program Files\MSRASI\msbnx\Samples\Networks\auto.dsc",
@"C:\Program Files\MSRASI\msbnx\Samples\Networks\errorfile.log",
INFERENUM.ine_Default, RECOMMENDENUM.recommendtype_Default);
axDgVw1.BeginInit();
axDgVw1.Model = model1;
}
</code>
THIS is the method I need help on. I can not get it to to compile
succesfully and create the nodes. It seems that C# needs all of the
arguments but I don't understand how to satisfy the requirenment. I am
basically tring to rewrite this Visual Basic code from the example
http://research.microsoft.com/adapt/MSBNx/msbn3/Overviews/Distributions.htm
in C#.
<code>
private void button2_Click(object sender, EventArgs e)
{
MSBN3Lib.MSBN aMSBN = new MSBN3Lib.MSBN();
MSBN3Lib.Model model1 = aMSBN.Models.Add(textbboxWord.Text,
null, null, MSBN3Lib.INFERENUM.ine_Default,
MSBN3Lib.RECOMMENDENUM.recommendtype_Default);
MSBN3Lib.Node aNode;
MSBN3Lib.Dist aDist;
MSBN3Lib.Properties aProp;
************** Does not compile*****************
aNode = model1.ModelNodes.Add("EngineStart", "Is engine
started?", ref model1, ref model1, aDist, aProp);
************** Does not compile*****************
//aNode.set_States("Working");
//aNode.set_States("Broken");
axDgVw1.BeginInit();
axDgVw1.Model = model1;
}
</code>
Can you make sure that it compiles for whom ever answers the question
before posting an answer?
Thank you very much. |