Пример #1
0
        public MediaInfo(string infilepath, System.Windows.Window owner)
        {
            this.InitializeComponent();
            this.Owner = owner;
            this.infilepath = infilepath;

            DDHelper ddh = new DDHelper(this);
            ddh.GotFiles += new DDEventHandler(ddh_GotFiles);

            if (Settings.MI_WrapText)
            {
                check_wrap.IsChecked = true;
                tbxInfo.TextWrapping = TextWrapping.Wrap;
            }
            else
            {
                check_wrap.IsChecked = false;
                tbxInfo.TextWrapping = TextWrapping.NoWrap;
            }

            check_mi_full.IsChecked = Settings.MI_Full;
            check_mi_full.Content = Languages.Translate("Full info");
            check_wrap.Content = Languages.Translate("Wrap text");
            button_open.Content = Languages.Translate("Open");
            button_save.Content = Languages.Translate("Save");
            button_close.Content = Languages.Translate("Close");
            tbxInfo.ToolTip = Languages.Translate("Drag and Drop your files here");

            if (!string.IsNullOrEmpty(infilepath))
                GetInfo();

            ShowDialog();
        }
Пример #2
0
        public MediaInfo(string infilepath, System.Windows.Window owner)
        {
            this.InitializeComponent();
            this.Owner      = owner;
            this.infilepath = infilepath;

            DDHelper ddh = new DDHelper(this);

            ddh.GotFiles += new DDEventHandler(ddh_GotFiles);

            if (Settings.MI_WrapText)
            {
                check_wrap.IsChecked = true;
                tbxInfo.TextWrapping = TextWrapping.Wrap;
            }
            else
            {
                check_wrap.IsChecked = false;
                tbxInfo.TextWrapping = TextWrapping.NoWrap;
            }

            check_mi_full.IsChecked = Settings.MI_Full;
            check_mi_full.Content   = Languages.Translate("Full info");
            check_wrap.Content      = Languages.Translate("Wrap text");
            button_open.Content     = Languages.Translate("Open");
            button_save.Content     = Languages.Translate("Save");
            button_close.Content    = Languages.Translate("Close");
            tbxInfo.ToolTip         = Languages.Translate("Drag and Drop your files here");

            if (!string.IsNullOrEmpty(infilepath))
            {
                GetInfo();
            }

            ShowDialog();
        }
Пример #3
0
        public MainWindow()
        {
            this.InitializeComponent();

            try
            {
                //Установка параметров окна из сохраненных настроек
                if ((check_window_size.IsChecked = Settings.WindowResize))
                {
                    string[] value = (Settings.WindowLocation).Split('/');
                    if (value.Length == 4)
                    {
                        this.Width = Convert.ToDouble(value[0]);
                        this.Height = Convert.ToDouble(value[1]);
                        this.Left = Convert.ToDouble(value[2]);
                        this.Top = Convert.ToDouble(value[3]);
                    }
                }

                this.button_open.Content = Languages.Translate("Open");
                this.button_open.ToolTip = Languages.Translate("Open media file");
                this.button_close.Content = Languages.Translate("Close");
                this.button_close.ToolTip = Languages.Translate("Close current file");
                this.button_exit.Content = Languages.Translate("Exit");
                this.button_exit.ToolTip = Languages.Translate("Exit from application");
                this.button_play.ToolTip = Languages.Translate("Play-Pause");
                this.button_frame_back.ToolTip = Languages.Translate("Frame back");
                this.button_frame_forward.ToolTip = Languages.Translate("Frame forward");
                this.button_stop.ToolTip = Languages.Translate("Stop");
                this.button_fullscreen.ToolTip = Languages.Translate("Fullscreen mode");
                this.slider_Volume.ToolTip = Languages.Translate("Volume");
                this.button_settings.ToolTip = Languages.Translate("Settings");
                this.menu_player_engine.Header = Languages.Translate("Player engine");
                this.check_old_seeking.ToolTip = Languages.Translate("If checked, Old method (continuous positioning while you move slider) will be used,") +
                    Environment.NewLine + Languages.Translate("otherwise New method is used (recommended) - position isn't set untill you release mouse button");

                this.menu_misc.Header = Languages.Translate("Misc");
                this.check_win7_taskbar.Header = Languages.Translate("Enable Windows 7 taskbar progress indication");
                this.check_window_size.Header = Languages.Translate("Restore the size and location of the main window");
                this.check_window_pos.Header = Languages.Translate("Fit windows to the working area bounds");

                if (Settings.PlayerEngine == Settings.PlayerEngines.DirectShow) check_engine_directshow.IsChecked = true;
                else if (Settings.PlayerEngine == Settings.PlayerEngines.MediaBridge) check_engine_mediabridge.IsChecked = true;

                Settings.VRenderers vr = Settings.VideoRenderer;
                if (vr == Settings.VRenderers.Auto) vr_default.IsChecked = true;
                else if (vr == Settings.VRenderers.Overlay) vr_overlay.IsChecked = true;
                else if (vr == Settings.VRenderers.VMR7) vr_vmr7.IsChecked = true;
                else if (vr == Settings.VRenderers.VMR9) vr_vmr9.IsChecked = true;
                else if (vr == Settings.VRenderers.EVR) vr_evr.IsChecked = true;

                check_old_seeking.IsChecked = OldSeeking = Settings.OldSeeking;
                check_win7_taskbar.IsChecked = Settings.Win7TaskbarIsEnabled;

                //Установка значения громкости из реестра
                slider_Volume.Value = Settings.VolumeLevel;
                VolumeSet = -(int)(10000 - Math.Pow(slider_Volume.Value, 1.0 / 5) * 10000);
                if (slider_Volume.Value == 0) image_volume.Source = new BitmapImage(new Uri(@"../pictures/Volume2.png", UriKind.RelativeOrAbsolute));
                slider_Volume.ValueChanged += new RoutedPropertyChangedEventHandler<double>(Volume_ValueChanged); //Не в xaml, чтоб не срабатывал до загрузки

                //Определяем коэффициент dpi
                RetrieveDPI();

                DDHelper ddh = new DDHelper(this);
                ddh.GotFiles += new DDEventHandler(DD_GotFiles);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("LoadSettings: " + ex.Message, Languages.Translate("Error"), MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }