Exemplo n.º 1
0
        private void button_save_Click(object sender, RoutedEventArgs e)
        {
            if (infilepath != null)
            {
                try
                {
                    System.Windows.Forms.SaveFileDialog s = new System.Windows.Forms.SaveFileDialog();
                    s.SupportMultiDottedExtensions = true;
                    s.DefaultExt   = ".log";
                    s.AddExtension = true;
                    s.Title        = Languages.Translate("Select unique name for output file:");
                    s.Filter       = "LOG " + Languages.Translate("files") + "|*.log" +
                                     "|TXT " + Languages.Translate("files") + "|*.txt";

                    s.InitialDirectory = Path.GetDirectoryName(infilepath);
                    s.FileName         = Path.GetFileName(infilepath) + " - " + infomode.ToString(); //.ToLower();

                    if (s.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        File.WriteAllText(s.FileName, tbxInfo.Text); //, System.Text.Encoding.Default);
                    }
                }
                catch (Exception ex)
                {
                    ErrorException(ex);
                }
            }
        }
Exemplo n.º 2
0
        public MediaInfo(string infilepath, InfoMode infomode, System.Windows.Window owner)
        {
            this.InitializeComponent();
            this.Owner      = owner;
            this.infomode   = infomode;
            this.infilepath = infilepath;

            DDHelper ddh = new DDHelper(this);

            ddh.GotFiles += new DDEventHandler(DD_GotFiles);

            Title = "Info (" + infomode.ToString() + ")";
            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");
            check_wrap.Content   = Languages.Translate("Wrap text");

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

            foreach (string info in Enum.GetNames(typeof(InfoMode)))
            {
                combo_info.Items.Add(info);
            }
            combo_info.SelectedItem = infomode.ToString();

            if (infilepath != null)
            {
                GetInfo();
            }

            Show();
        }
Exemplo n.º 3
0
        public MediaInfo(string infilepath, InfoMode infomode, System.Windows.Window owner)
        {
            this.InitializeComponent();
            this.Owner = owner;
            this.infomode = infomode;
            this.infilepath = infilepath;

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

            Title = "Info (" + infomode.ToString() + ")";
            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");
            check_wrap.Content = Languages.Translate("Wrap text");

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

            foreach (string info in Enum.GetNames(typeof(InfoMode)))
                combo_info.Items.Add(info);
            combo_info.SelectedItem = infomode.ToString();

            if (infilepath != null)
                GetInfo();

            Show();
        }
Exemplo n.º 4
0
        private void combo_info_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((combo_info.IsDropDownOpen || combo_info.IsSelectionBoxHighlighted) && combo_info.SelectedItem != null)
            {
                infomode = (InfoMode)Enum.Parse(typeof(InfoMode), combo_info.SelectedItem.ToString(), true);
                Title    = "Info (" + infomode.ToString() + ")";

                if (infilepath != null)
                {
                    tbxInfo.Clear();
                    tbxInfo.ScrollToHome();
                    GetInfo();
                }
            }
        }
Exemplo n.º 5
0
        private void combo_info_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((combo_info.IsDropDownOpen || combo_info.IsSelectionBoxHighlighted) && combo_info.SelectedItem != null)
            {
                infomode = (InfoMode)Enum.Parse(typeof(InfoMode), combo_info.SelectedItem.ToString(), true);
                Title = "Info (" + infomode.ToString() + ")";

                if (infilepath != null)
                {
                    tbxInfo.Clear();
                    tbxInfo.ScrollToHome();
                    GetInfo();
                }
            }
        }