示例#1
0
        private void Open_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter      = "Video|*.avi;*.mpg;*.wmv;*.mp4;*.srt";
            dlg.Multiselect = false;
            if (dlg.ShowDialog().Value == true)
            {
                if (dlg.FileNames.Count() == 0)
                {
                    return;
                }

                foreach (string filename in dlg.FileNames)
                {
                    string path = System.IO.Path.GetFullPath(dlg.FileName);
                    path  = path.Substring(0, path.LastIndexOf('\\'));
                    pathM = path;
                    _FileInfo NewFile = new _FileInfo {
                        FullName = filename, Location = path
                    };
                    b = false;
                    _SelectedFilePath = NewFile.FullName;
                    this.Title        = NewFile.ToString();
                    //Debug.WriteLine("path &&&" + pathM);
                }
                Func();
                b = true;
            }
        }
示例#2
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            string[] files = e.Data.GetData(DataFormats.FileDrop) as string[];
            if (files == null)
            {
                return;
            }

            foreach (string filename in files)
            {
                _FileInfo NewFile = new _FileInfo {
                    FullName = filename
                };
                b = false;
                _SelectedFilePath = NewFile.FullName;
                this.Title        = NewFile.ToString();


                string path = System.IO.Path.GetFullPath(filename);
                path  = path.Substring(0, path.LastIndexOf('\\'));
                pathM = path;
            }
            Func();
            b = true;
        }