Exemple #1
0
 private void m_btnAddFormat_Click(object sender, EventArgs e)
 {
     using (ImportDateFormatDlg dlg = new ImportDateFormatDlg())
     {
         dlg.Initialize(String.Empty, m_helpTopicProvider, m_fGenDate);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             string       sFmt  = dlg.Format;
             string       sDate = m_dtExample.ToString(sFmt);
             ListViewItem lvi   = new ListViewItem(new string[] { sFmt, sDate });
             m_lvDateFormats.Items.Add(lvi);
         }
     }
 }
		private void m_btnAddFormat_Click(object sender, EventArgs e)
		{
			using (ImportDateFormatDlg dlg = new ImportDateFormatDlg())
			{
				dlg.Initialize(String.Empty, m_helpTopicProvider, m_fGenDate);
				if (dlg.ShowDialog(this) == DialogResult.OK)
				{
					string sFmt = dlg.Format;
					string sDate = m_dtExample.ToString(sFmt);
					ListViewItem lvi = new ListViewItem(new string[] { sFmt, sDate });
					m_lvDateFormats.Items.Add(lvi);
				}
			}
		}
Exemple #3
0
 private void m_btnModifyFormat_Click(object sender, EventArgs e)
 {
     if (m_lvDateFormats.SelectedItems.Count > 0)
     {
         ListViewItem lvi = m_lvDateFormats.SelectedItems[0];
         using (ImportDateFormatDlg dlg = new ImportDateFormatDlg())
         {
             dlg.Initialize(lvi.SubItems[0].Text, m_helpTopicProvider, m_fGenDate);
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
                 string sFmt  = dlg.Format;
                 string sDate = m_dtExample.ToString(sFmt);
                 lvi.SubItems[0].Text = sFmt;
                 lvi.SubItems[1].Text = sDate;
             }
         }
     }
 }
		private void m_btnModifyFormat_Click(object sender, EventArgs e)
		{
			if (m_lvDateFormats.SelectedItems.Count > 0)
			{
				ListViewItem lvi = m_lvDateFormats.SelectedItems[0];
				using (ImportDateFormatDlg dlg = new ImportDateFormatDlg())
				{
					dlg.Initialize(lvi.SubItems[0].Text, m_helpTopicProvider, m_fGenDate);
					if (dlg.ShowDialog(this) == DialogResult.OK)
					{
						string sFmt = dlg.Format;
						string sDate = m_dtExample.ToString(sFmt);
						lvi.SubItems[0].Text = sFmt;
						lvi.SubItems[1].Text = sDate;
					}
				}

			}
		}