當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。