当前位置: 首页>>代码示例>>C#>>正文


C# EventArgs.ToString方法代码示例

本文整理汇总了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);
        }
开发者ID:kpro1999,项目名称:appccelerate,代码行数:16,代码来源:DefaultEventMessageFactoryTest.cs

示例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();
            }
        }
开发者ID:BISmb,项目名称:Projects,代码行数:29,代码来源:Default.aspx.cs

示例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());
        }
开发者ID:WenningQiu,项目名称:appccelerate,代码行数:16,代码来源:DefaultEventMessageFactoryTest.cs

示例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!");
                    }

                }
        }
开发者ID:KingBARD,项目名称:Twitter-Wrapper-API,代码行数:28,代码来源:TweetExample.cs

示例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();
        }
开发者ID:dzenisan,项目名称:bezpanike,代码行数:7,代码来源:Global.asax.cs

示例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
 }
开发者ID:nightphoenix13,项目名称:BookExceptionDemoGUI,代码行数:32,代码来源:Form1.cs

示例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");
        }
开发者ID:siwy4430,项目名称:StartupRepository,代码行数:7,代码来源:Form1.cs

示例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());
 }
开发者ID:evanjamesjackson,项目名称:learning,代码行数:8,代码来源:Form1.cs

示例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);
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:32,代码来源:FileReferenceList.cs

示例10: Application_Error

 protected void Application_Error(object sender, EventArgs e)
 {
     Exception ex = Server.GetLastError();
     if (ex != null)
     {
         logger.Error(e.ToString());
     }
 }
开发者ID:JeanNguon,项目名称:Projet,代码行数:8,代码来源:Global.asax.cs

示例11: OnError

 protected override void OnError(EventArgs e)
 {
     base.OnError(e);
     if (e.ToString().Equals("请重新登录"))
     {
         Response.Redirect(NoAuthUrl);
     }
 }
开发者ID:unie,项目名称:TestGitF,代码行数:8,代码来源:BasePage.cs

示例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;
 }
开发者ID:kaizadj,项目名称:ebu-radio-production,代码行数:8,代码来源:AudioManager.cs

示例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
     {
     }
 }
开发者ID:MItsutoshiNAKANO,项目名称:chkDrop,代码行数:10,代码来源:ChkDrop.aspx.cs

示例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
        }
开发者ID:ssjylsg,项目名称:crm,代码行数:12,代码来源:Global.asax.cs

示例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>"); }
            }
        }
开发者ID:wangyuanmingda,项目名称:YumiYumi,代码行数:12,代码来源:menu_list.aspx.cs


注:本文中的System.EventArgs.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。