示例#1
0
 private void SaveDataButton_Click(object sender, RoutedEventArgs e)
 {
     terminal.SaveData(System.IO.Directory.GetCurrentDirectory(), "TESTE321.txt", Encoding.UTF8, new string[2] {
         "Computer", "Device"
     }, true, true);
     if (!(terminal is null))
     {
         SaveDataWindow window = new SaveDataWindow(terminal);
         window.Show();
     }
 }
示例#2
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            var directory     = DirectoryTextBox.Text;
            var fileName      = FileNameTextBox.Text;
            var showSenders   = (bool)ShowSendersCheckBox.IsChecked;
            var NewLine       = (bool)NewLinesCheckBox.IsChecked;
            var SendersToShow = new List <String>(4);

            if ((bool)Computer1CheckBox.IsChecked)
            {
                SendersToShow.Add("Computer");
            }
            if ((bool)Terminal1CheckBox.IsChecked)
            {
                SendersToShow.Add("Device");
            }
            if ((bool)Terminal2CheckBox.IsChecked)
            {
                SendersToShow.Add("Device2");
            }
            if ((bool)Terminal3CheckBox.IsChecked)
            {
                SendersToShow.Add("Device3");
            }

            try
            {
                var c = File.Create(directory + @"\" + fileName);
                c.Close();
            }
            catch (Exception e_)
            {
                System.Windows.MessageBox.Show(e_.Message, "Error");
                return;
            }
            terminal.SaveData(directory, fileName, Encoding.UTF8, SendersToShow, true, NewLine);


            this.Close();
        }