Пример #1
0
 void OnFilterChanged(IFileDlgExt sender, int index)
 {
     if (_oldFilterIndex != index)
     {
         _oldFilterIndex = index;
         _eventFilterChanged?.Invoke(sender, index);
     }
 }
 void OnFilterChanged(IFileDlgExt sender, int index)
 {
     if (_oldFilterIndex != index)
     {
         _oldFilterIndex = index;
         if (_eventFilterChanged != null)
         {
             _eventFilterChanged(sender, index);
         }
     }
 }
Пример #3
0
 void ParentDlg_EventFolderNameChanged(IFileDlgExt sender, string filePath)
 {
     _Media.Stop();
     _Media.Source             = null;
     sender.FileDlgEnableOkBtn = false;
     _fsize.Content            = string.Empty;
     _size.Content             = string.Empty;
     _duration.Content         = string.Empty;
     TimeSlider.IsEnabled      = false;
     _playButton.IsEnabled     = false;
     _muteButt.IsEnabled       = false;
 }
Пример #4
0
 void OnPathChanged(IFileDlgExt sender, string pathName)
 {
     if (string.IsNullOrEmpty(System.IO.Path.GetFileName(pathName)) || _oldPath == pathName)
     {
         return;
     }
     _oldPath = pathName;
     if (File.Exists(pathName))
     {
         _eventFileNameChanged?.Invoke(sender, pathName);
     }
     else if (Directory.Exists(pathName))
     {
         _eventFolderNameChanged?.Invoke(sender, pathName);
     }
 }
Пример #5
0
        void ParentDlg_EventFileNameChanged(IFileDlgExt sender, string filePath)
        {
            _Media.Stop();
            _Media.SpeedRatio         = 1;
            _comboSpeed.SelectedIndex = 1;
            _comboSpeed.IsEnabled     = true;
            if (!string.IsNullOrEmpty(System.IO.Path.GetFileName(filePath)))
            {
                sender.FileDlgEnableOkBtn = true;
                using (System.IO.FileStream file = System.IO.File.OpenRead(filePath))
                {
                    _fsize.Content = string.Format("{0:#,#} bytes", file.Length);
                    if (file.Length > 0)
                    {
                        _filePath = filePath;
                    }
                }
                _Media.Source         = new Uri(_filePath);
                _playButton.IsEnabled = false;
                _muteButt.IsEnabled   = false;
                _Media.Volume         = 50;
                _Media.SpeedRatio     = _speed;
                _Media.Play();
                _playButton.Content = "Pause";
                _isPaused           = false;
                _muteButt.IsEnabled = false;
            }
            else
            {
                sender.FileDlgEnableOkBtn = false;
                _fsize.Content            = string.Empty;
                _size.Content             = string.Empty;
                _duration.Content         = string.Empty;
                _Media.Source             = null;
                _playButton.Content       = "Play";
                _playButton.IsEnabled     = false;
                _muteButt.IsEnabled       = false;
            }
            TimeSlider.IsEnabled = false;
            _muteButt.Content    = "Mute";
            _size.Content        = string.Empty;

            this._duration.Content = string.Empty;
        }
Пример #6
0
        private void ParentDlg_EventFileNameChanged(IFileDlgExt sender, string filePath)
        {
            if (File.Exists(filePath))
            {
                ZipFileAdapter zipFileAdapter = null;
                try
                {
                    zipFileAdapter = ZipFileAdapterManager.CreateInstance(filePath);
                    string projName  = Path.GetFileNameWithoutExtension(filePath);
                    string imagePath = "Preview.png";
                    if (zipFileAdapter.GetEntryNames().Contains(imagePath))
                    {
                        BitmapImage bitmapImage = new BitmapImage();
                        bitmapImage.BeginInit();

                        Stream stream = zipFileAdapter.GetEntryStreamByName(imagePath);
                        byte[] bytes  = new byte[stream.Length];
                        stream.Read(bytes, 0, (int)stream.Length);

                        MemoryStream memoryStream = new MemoryStream(bytes);
                        bitmapImage.StreamSource = memoryStream;
                        bitmapImage.EndInit();
                        image.Source = bitmapImage;
                    }
                }
                catch (Exception ex)
                {
                    GisEditor.LoggerManager.Log(LoggerLevel.Debug, ex.Message, new ExceptionInfo(ex));
                    System.Windows.Forms.MessageBox.Show(ex.Message, "Warning", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                }
                finally
                {
                    if (zipFileAdapter != null)
                    {
                        zipFileAdapter.Dispose();
                    }
                }
            }
        }
Пример #7
0
 void ParentDlg_EventFilterChanged(IFileDlgExt sender, int index)
 {
 }
Пример #8
0
 void ParentDlg_EventFileNameChanged(IFileDlgExt sender, string filePath)
 {
     ShowFileInfo(filePath);
 }
Пример #9
0
 void ParentDlg_EventFilterChanged(IFileDlgExt sender, int index)
 {
     ShowFileInfo(null);
 }