有一个类:
}
public class SSEventArgs : EventArgs
{
// Fields
private string _description;
private string _eventName;
private string _moduleName;
private DateTime _time; // Methods
public SSEventArgs(string eventName, string moduleName)
{
this._eventName = eventName;
this._moduleName = moduleName;
DateTime now = DateTime.Now;
this._time = now;
} public SSEventArgs(string eventName, string moduleName, string description)
{
this._eventName = eventName;
this._moduleName = moduleName;
this._description = description;
DateTime now = DateTime.Now;
this._time = now;
} public override string ToString()
{
string str = null;
str = string.Format("'{0}' occurred in '{1}'.", this._eventName, this._moduleName);
if (!string.IsNullOrEmpty(this._description))
{
str = str + this._description;
}
return str;
} // Properties
public string Description
{
get
{
return this._description;
}
set
{
this._description = value;
}
} public string EventName
{
get
{
return this._eventName;
}
} public string ModuleName
{
get
{
return this._moduleName;
}
set
{
this._moduleName = value;
}
} public DateTime Time
{
get
{
return this._time;
}
} }
public sealed class SSIOChangeEventArgs : SSEventArgs
{
// Fields
private string _channelName;
private object _channelValue; // Methods
public SSIOChangeEventArgs(string eventName, string moduleName): base(eventName, moduleName)
{
ChannelName = _channelName;
ChannelValue = _channelValue;
} public override string ToString()
{
return string.Format("'{0}'.IOChannel Name = '{1}'; IOChannel Value = '{2}'.", base.ToString(), this._channelName, this._channelValue);
} // Properties
public string ChannelName
{
get
{
return this._channelName;
}
set
{
this._channelName = value;
}
} public object ChannelValue
{
get
{
return this._channelValue;
}
set
{
this._channelValue = value;
}
}
}
引用代码是: private void OnIOChannelChange(string channelName, string channelType, object channelValue)
{
EventTest.SSIOChangeEventArgs e = new EventTest.SSIOChangeEventArgs("IOChannelChangeEvent", "IOServerAgent")
{ChannelName = channelName,ChannelValue = channelValue };
}为什么这样引用不行呢?
}
public class SSEventArgs : EventArgs
{
// Fields
private string _description;
private string _eventName;
private string _moduleName;
private DateTime _time; // Methods
public SSEventArgs(string eventName, string moduleName)
{
this._eventName = eventName;
this._moduleName = moduleName;
DateTime now = DateTime.Now;
this._time = now;
} public SSEventArgs(string eventName, string moduleName, string description)
{
this._eventName = eventName;
this._moduleName = moduleName;
this._description = description;
DateTime now = DateTime.Now;
this._time = now;
} public override string ToString()
{
string str = null;
str = string.Format("'{0}' occurred in '{1}'.", this._eventName, this._moduleName);
if (!string.IsNullOrEmpty(this._description))
{
str = str + this._description;
}
return str;
} // Properties
public string Description
{
get
{
return this._description;
}
set
{
this._description = value;
}
} public string EventName
{
get
{
return this._eventName;
}
} public string ModuleName
{
get
{
return this._moduleName;
}
set
{
this._moduleName = value;
}
} public DateTime Time
{
get
{
return this._time;
}
} }
public sealed class SSIOChangeEventArgs : SSEventArgs
{
// Fields
private string _channelName;
private object _channelValue; // Methods
public SSIOChangeEventArgs(string eventName, string moduleName): base(eventName, moduleName)
{
ChannelName = _channelName;
ChannelValue = _channelValue;
} public override string ToString()
{
return string.Format("'{0}'.IOChannel Name = '{1}'; IOChannel Value = '{2}'.", base.ToString(), this._channelName, this._channelValue);
} // Properties
public string ChannelName
{
get
{
return this._channelName;
}
set
{
this._channelName = value;
}
} public object ChannelValue
{
get
{
return this._channelValue;
}
set
{
this._channelValue = value;
}
}
}
引用代码是: private void OnIOChannelChange(string channelName, string channelType, object channelValue)
{
EventTest.SSIOChangeEventArgs e = new EventTest.SSIOChangeEventArgs("IOChannelChangeEvent", "IOServerAgent")
{ChannelName = channelName,ChannelValue = channelValue };
}为什么这样引用不行呢?
解决方案 »
- 网站爬虫之Ajax异步数据传输抓取
- 怎么在Dictionary集合中添加一个新的列
- 请教控件ucgrid的合并方法
- 如何取得UDP 遠端IP
- 用CommandBuilder把Datagrid更新到数据源的问题!!winform下的,access (分都快给光了。。。)
- 谁对System.Windows.Forms下的BindingSource熟悉的,过来看看啊~~
- 菜鸟紧急求救,如何在winform上实现webform的table或者类似的控件
- 显示接口调用问题 请高手指教
- 怎样用c#取一副图象的象素
- 一个小问题
- 准备为一个朋友写个C#小应用,希望大牛们给点建议。
- 如何实现多个窗体中的定时器同步(即如何在一个窗体内控制另一个窗体里的控件)?
public class SSEventArgs : EventArgs
{
// Fields
private string _description;
private string _eventName;
private string _moduleName;
private DateTime _time; // Methods
public SSEventArgs(string eventName, string moduleName)
{
_eventName = eventName;
_moduleName = moduleName;
DateTime now = DateTime.Now;
_time = now;
} public SSEventArgs(string eventName, string moduleName, string description)
{
_eventName = eventName;
_moduleName = moduleName;
_description = description;
DateTime now = DateTime.Now;
_time = now;
} public override string ToString()
{
var str = string.Format("'{0}' occurred in '{1}'.", this._eventName, this._moduleName);
if (!string.IsNullOrEmpty(this._description))
{
str = str + _description;
}
return str;
} // Properties
public string Description
{
get
{
return _description;
}
set
{
_description = value;
}
} public string EventName
{
get
{
return _eventName;
}
} public string ModuleName
{
get
{
return _moduleName;
}
set
{
_moduleName = value;
}
} public DateTime Time
{
get
{
return _time;
}
} }
public sealed class SSIOChangeEventArgs : SSEventArgs
{
// Fields
private string _channelName;
private object _channelValue; // Methods
public SSIOChangeEventArgs(string eventName, string moduleName)
: base(eventName, moduleName)
{
ChannelName = _channelName;
ChannelValue = _channelValue;
} public override string ToString()
{
return string.Format("'{0}'.IOChannel Name = '{1}'; IOChannel Value = '{2}'.", base.ToString(), this._channelName, this._channelValue);
} // Properties
public string ChannelName
{
get
{
return _channelName;
}
set
{
_channelName = value;
}
} public object ChannelValue
{
get
{
return _channelValue;
}
set
{
_channelValue = value;
}
}
} private void OnIOChannelChange(string channelName, string channelType, object channelValue)
{
EventTest.SSIOChangeEventArgs e = new EventTest.SSIOChangeEventArgs("IOChannelChangeEvent", "IOServerAgent") { ChannelName = channelName, ChannelValue = channelValue };
}
private void OnIOChannelChange(string channelName, string channelType, object channelValue)
{
var e = new SSIOChangeEventArgs("IOChannelChangeEvent", "IOServerAgent") { ChannelName = channelName, ChannelValue = channelValue };
}
private void OnIOChannelChange(string channelName, string channelType, object channelValue)
{
var e = new SSIOChangeEventArgs("IOChannelChangeEvent", "IOServerAgent") { ChannelName = channelName, ChannelValue = channelValue };
}