Ejemplo n.º 1
0
        private void menuAddFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == true)
            {
                recordFiles.Add(RecordFileName.ConvFullnameToRecordFilename(ofd));
            }
        }
Ejemplo n.º 2
0
        public static RecordFileName ConvFullnameToRecordFilename(string path)
        {
            RecordFileName rfn = new RecordFileName();

            rfn.Filename    = Path.GetFileName(path);
            rfn.NewFilename = rfn.Filename;
            rfn.FilePath    = Path.GetDirectoryName(path);
            rfn.FileError   = "";

            return(rfn);
        }
Ejemplo n.º 3
0
        public static RecordFileName ConvFullnameToRecordFilename(OpenFileDialog ofd)
        {
            RecordFileName rfn = new RecordFileName();

            rfn.Filename    = ofd.SafeFileName;
            rfn.NewFilename = rfn.Filename;
            rfn.FilePath    = Path.GetDirectoryName(ofd.FileName);
            rfn.FileError   = "";

            return(rfn);
        }
Ejemplo n.º 4
0
        private void menuAddFileDirectory_Click(object sender, RoutedEventArgs e)
        {
            using (var fbd = new System.Windows.Forms.FolderBrowserDialog())
            {
                System.Windows.Forms.DialogResult dialogResult = fbd.ShowDialog();

                if (dialogResult == System.Windows.Forms.DialogResult.OK &&
                    !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    string[] files = Directory.GetFiles(fbd.SelectedPath);

                    foreach (var file in files)
                    {
                        recordFiles.Add(RecordFileName.ConvFullnameToRecordFilename(file));
                    }
                }
            }
        }