本文整理汇总了C#中System.EventArgs.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# EventArgs.ToString方法的具体用法?C# EventArgs.ToString怎么用?C# EventArgs.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.EventArgs
的用法示例。
在下文中一共展示了EventArgs.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEventFiredMessage_MustAssignPropertiesWithInitializer
public void CreateEventFiredMessage_MustAssignPropertiesWithInitializer(string distributedIdentification, Guid identification, string topic, EventArgs eventArgs)
{
var result = this.testee.CreateEventFiredMessage(x =>
{
x.DistributedEventBrokerIdentification =
distributedIdentification;
x.EventBrokerIdentification = identification.ToString();
x.Topic = topic;
x.EventArgs = eventArgs.ToString();
});
Assert.Equal(distributedIdentification, result.DistributedEventBrokerIdentification);
Assert.Equal(identification.ToString(), result.EventBrokerIdentification);
Assert.Equal(topic, result.Topic);
Assert.Equal(eventArgs.ToString(), result.EventArgs);
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
initConn("DEVCRM", "SQLDEV", "MBS", "sa", "Cacc3ssr0");
try
{
string query = "EXEC sp_helptext '@';";
string query = query.Replace("@", "dbo.getAccounts");
con.Open();
SqlCommand command = new SqlCommand(newQuery, con);
command.CommandType = System.Data.CommandType.Text;
Response.Write(command.CommandText);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
string text = reader["Text"].ToString();
Response.Write(text + System.Environment.NewLine);
}
con.Close();
}
catch
{
//Response.Write(e.InnerException.ToString());
e.ToString();
}
}
示例3: AssignsPropertiesWithInitializerOnCreatedMessage
public void AssignsPropertiesWithInitializerOnCreatedMessage(string distributedIdentification, Guid identification, string topic, EventArgs eventArgs)
{
var result = this.testee.CreateEventFiredMessage(x =>
{
x.DistributedEventBrokerIdentification =
distributedIdentification;
x.EventBrokerIdentification = identification.ToString();
x.Topic = topic;
x.EventArgs = eventArgs.ToString();
});
result.DistributedEventBrokerIdentification.Should().Be(distributedIdentification);
result.EventBrokerIdentification.Should().Be(identification.ToString());
result.Topic.Should().Be(topic);
result.EventArgs.Should().Be(eventArgs.ToString());
}
示例4: button2_Click
private void button2_Click(object sender, EventArgs e)
{
if(textBox1.Text == null)
{
return;
}
else
{
try
{
string Tweet = textBox1.Text;
Client.Tweet(Tweet, false);
if (Client.Tweeted == true)
{
MessageBox.Show("Tweeted!");
}
else
{
MessageBox.Show("Tweet failed!" + e.ToString());
}
}
catch (WebException)
{
MessageBox.Show("You already tweeted that!");
}
}
}
示例5: Application_Error
protected void Application_Error(object sender, EventArgs e)
{
Log.Error(sender, "Error caught by the Global.asax: " + e.ToString());
var redirector = ObjectFactory.GetInstance<IRedirector>();
//redirector.GoToErrorPage();
}
示例6: addBookButton_Click
private void addBookButton_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(titleTextBox.Text) ||
String.IsNullOrEmpty(authorTextBox.Text) ||
String.IsNullOrEmpty(priceTextBox.Text) ||
String.IsNullOrEmpty(pagesTextBox.Text))
{
MessageBox.Show("You must fill out all fields.", "Missing Information",
MessageBoxButtons.OK, MessageBoxIcon.Error);
} // end if
else
{
if (count == SIZE)
{
MessageBox.Show("You can only have 5 books.", "Max Books",
MessageBoxButtons.OK, MessageBoxIcon.Error);
} // end if
try
{
books[count] = new Book(titleTextBox.Text, authorTextBox.Text,
Convert.ToDouble(priceTextBox.Text), Convert.ToInt32(
pagesTextBox.Text));
count++;
refreshBooks();
} // end try
catch (FormatException exception)
{
MessageBox.Show(e.ToString(), "Exception", MessageBoxButtons.OK,
MessageBoxIcon.Error);
} // end catch
} // end else
}
示例7: Okno_Klik
private void Okno_Klik(object sender, EventArgs e)
{
MessageBox.Show("Obiekt ktory wywolal zdarzenie: " + sender.ToString());
MessageBox.Show("Argumenty zdarzenia zdarzenie: " + e.ToString());
MessageBox.Show("Kliknieto na forme - moje zdarzenie");
}
示例8: button1_Click
/* This method handles the event of button1 being clicked */
private void button1_Click(object sender, EventArgs e)
{
/* "sender" indicates which object sent the event */
MessageBox.Show("Sender object: " + sender.ToString());
/* "e" is an object of the EventArgs class and indicates what event has been raised */
MessageBox.Show("EventArgs: " + e.ToString());
}
示例9: OnViewReferencedFilesClick
void OnViewReferencedFilesClick(object sender, EventArgs e)
{
List<string> allFiles = null;
bool didErrorOccur = false;
string errorText = null;
try
{
allFiles =
ContentParser.GetFilesReferencedByAsset(mLastFileName, TopLevelOrRecursive.Recursive);
}
catch(Exception exc)
{
didErrorOccur = true;
errorText = e.ToString();
}
if (didErrorOccur)
{
MessageBox.Show("Could not track references because of a missing file: " + errorText);
}
else
{
string message = "Referenced files:\n";
foreach (string file in allFiles)
{
message += file + "\n";
}
MessageBox.Show(message);
}
}
示例10: Application_Error
protected void Application_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex != null)
{
logger.Error(e.ToString());
}
}
示例11: OnError
protected override void OnError(EventArgs e)
{
base.OnError(e);
if (e.ToString().Equals("请重新登录"))
{
Response.Redirect(NoAuthUrl);
}
}
示例12: AudioManager_instantUpdate
void AudioManager_instantUpdate(object sender, EventArgs e)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("INSTANT Update to " + this.periodicUpdate.GetInvocationList().Count() + " listener(s)");
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine(e.ToString());
Console.ForegroundColor = ConsoleColor.White;
}
示例13: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
try {
Label1.Text = e.ToString() + " " + sender.ToString();
} catch (HttpException er) {
Label1.Text = er.StackTrace;
} finally
{
}
}
示例14: Application_Error
protected void Application_Error(object sender, EventArgs e)
{
log4net.LogManager.GetLogger(this.GetType()).Error(sender + e.ToString());
#if RELEASE
Server.ClearError();
string url = AspNetHelper.WebUrl() + "/Error.htm";
Response.Redirect(url);
// Response.Write("程序出现错误,请重新操作");
Response.End();
#endif
}
示例15: Unnamed_Click
protected void Unnamed_Click(object sender, EventArgs e)
{
Response.Write("<Script Language='JavaScript'>alert('"+e.ToString()+"');</Script>");
string dishId = Request.Form["dishId"];
if (dishId != null)
{
DishDAO dishDAO = new DishDAO();
if (dishDAO.deleteById(Convert.ToInt32(dishId))) { Response.Write("<Script Language='JavaScript'>alert('添加成功');</Script>"); }
else { Response.Write("<Script Language='JavaScript'>alert('添加错误,亲!');</Script>"); }
}
}