【发布时间】:2012-12-03 06:30:17
【问题描述】:
//Class A
void OnChanged(object source, FileSystemEventArgs e)
{
XmlTextReader reader = new XmlTextReader("?"); <- How will I pass the "file" variable from Class B?
}
//Class B
public static bool myMethod(FileInfo file)
{
//some codes here
return false;
}
我知道您必须为此设置一些属性才能传递变量,但我还不确定从哪里开始。添加一些代码可以帮助我更好地理解属性。
【问题讨论】:
标签: c# parameters parameter-passing