outia24
10-05-2007, 05:48 AM
I am getting some test with winform.
But, when I clicked button1, "Test" property has nothing.
Do I need another code or something?
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object id="form1" type="MySpringSample_03.Form1, MySpringSample_03">
<property name="Test" value="hello world"/>
</object>
</objects>
</spring>
</configuration>
Form1.cs
public partial class Form1 : Form, IForm
{
private string test;
public string Test
{
get { return test; }
set { test = value; }
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Test=" + Test);
}
}
Thanks in advance.
But, when I clicked button1, "Test" property has nothing.
Do I need another code or something?
App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object id="form1" type="MySpringSample_03.Form1, MySpringSample_03">
<property name="Test" value="hello world"/>
</object>
</objects>
</spring>
</configuration>
Form1.cs
public partial class Form1 : Form, IForm
{
private string test;
public string Test
{
get { return test; }
set { test = value; }
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Test=" + Test);
}
}
Thanks in advance.