Exemplo n.º 1
0
 /// <summary>
 /// This function is the callback used to execute the command when the menu item is clicked.
 /// See the constructor to see how the menu item is associated with this function using
 /// OleMenuCommandService service and MenuCommand class.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">Event args.</param>
 private void Execute(object sender, EventArgs e)
 {
     ThreadHelper.ThrowIfNotOnUIThread();
     try
     {
         MainToolbox win = new MainToolbox();
         win.Show();
     }
     catch
     {
         MessageBox.Show("Проект не открыт");
     }
 }
Exemplo n.º 2
0
        private void Btn_Save_Click(object sender, RoutedEventArgs e)
        {
            StreamWriter sw = new StreamWriter(GeneralSettings.Default.path, true, System.Text.Encoding.Default);

            string name = textBoxName.Text;
            string date = GeneralSettings.Default.startTime.ToString("d");
            string time = MainToolbox.session_length();

            string new_line = "Name: " + name + " Date: " + date + " Time: " + time;

            sw.WriteLine(new_line);
            sw.Close();

            Close();
        }