本文整理汇总了C#中EventArgs.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# EventArgs.GetType方法的具体用法?C# EventArgs.GetType怎么用?C# EventArgs.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventArgs
的用法示例。
在下文中一共展示了EventArgs.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
public bool runTest()
{
Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
int iCountErrors = 0;
int iCountTestcases = 0;
String strLoc = "Loc_000oo";
String strValue = String.Empty;
try
{
EventArgs ea = new EventArgs();
iCountTestcases++;
if(ea == null)
{
iCountErrors++;
printerr( "Error_987ya! EventArgs not constructed");
}
iCountTestcases++;
if(!ea.GetType().FullName.Equals("System.EventArgs"))
{
iCountErrors++;
printerr("Error_498cy! Incorrect type");
}
iCountTestcases++;
} catch (Exception exc_general ) {
++iCountErrors;
Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy! strLoc=="+ strLoc +", exc_general=="+exc_general.ToString());
}
if ( iCountErrors == 0 )
{
Console.WriteLine( "paSs. "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
return true;
}
else
{
Console.WriteLine("FAiL! "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
return false;
}
}
示例2: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
Session.Timeout = int.Parse(txtSessionTimeOut.Text);
}
catch(Exception ex)
{
Session["ModuleName"] = " 系统信息参数设置";
Session["FunctionName"] = "btnSave_Click";
Session["ExceptionalType"] = e.GetType().FullName;
Session["ExceptionalDescription"] = ex.Message;
Response.Redirect("~/Common/MistakesPage.aspx");
}
SaveData(); //新的保存方法
}
示例3: TraceEvent
/* Events */
protected virtual void TraceEvent(HtmlGenericControl memo, object sender, EventArgs args, string eventName) {
string s = "";
PropertyInfo[] properties = args.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
foreach (PropertyInfo propertyInfo in properties) {
s += propertyInfo.Name + " = " +
(propertyInfo.PropertyType.IsValueType ? propertyInfo.GetValue(args, null) : "[" + propertyInfo.PropertyType.Name + "]") + "<br />";
}
memo.InnerHtml += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td valign=\"top\" style=\"width: 100px;\">Sender:</td><td valign=\"top\">" +
(sender as Control).ID +
"</td></tr><tr><td valign=\"top\">EventType:</td><td valign=\"top\"><b>" +
eventName + "</b></td></tr><tr><td valign=\"top\">Arguments:</td><td valign=\"top\">" +
s + "</td></tr></table><br />";
}
示例4: panStartedHandler
private void panStartedHandler(object sender, EventArgs e)
{
Debug.Log ("panStartedHandler()");
Debug.Log (e.GetType());
}