Пример #1
0
        public SearchResults(DatabaseUtil DB, DatabaseUtil.DBTable data, XMLUtil.SaveSettings ss, string profilename, List <string> SRS)
        {
            InitializeComponent();

            SetWindowScreen(this, GetWindowScreen(App.Current.MainWindow));
            SearchBar.AddHandler(System.Windows.Controls.Primitives.TextBoxBase.TextChangedEvent, new TextChangedEventHandler(ComboBox_TextChanged));

            Data                 = data;
            db                   = DB;
            ReturnFile           = "";
            ProfileName          = profilename;
            SaveSettings         = ss;
            BooleanSearchResults = SRS;
            if (BooleanSearchResults != null)
            {
                if (BooleanSearchResults.Count > 0)
                {
                    AddSearchResults(BooleanSearchResults);
                }
            }
        }
Пример #2
0
        public MediaFullscreen(string mediafile, TimeSpan position, XMLUtil.SaveSettings settings, List <string> Tags, bool mediaplay)
        {
            InitializeComponent();
            SetWindowScreen(this, GetWindowScreen(App.Current.MainWindow));

            try
            {
                this.Cursor  = Cursors.None;
                this.Topmost = true;
                mousedelay   = settings.Mousedisappeardelay;

                timer.Interval = new TimeSpan(0, 0, 1);
                timer.Tick    += new EventHandler(update_progress);
                mousewheeldonetimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
                mousewheeldonetimer.Tick    += new EventHandler(MouseWheel_Done);
                mousenomove.Interval         = new TimeSpan(0, 0, mousedelay);
                mousenomove.Tick            += new EventHandler(Mouse_nomove);

                if (Tags != null)
                {
                    if (Tags.Count > 0)
                    {
                        foreach (string tag in Tags)
                        {
                            if (tag.Contains("Event: "))
                            {
                                EventControls.Visibility = Visibility.Visible;
                                string   tagname = tag.Remove(0, 7);
                                string[] others  = tagname.Split('|');
                                Button   event1  = new Button
                                {
                                    Content = others[0],
                                    HorizontalContentAlignment = HorizontalAlignment.Center,
                                    Tag         = others[1],
                                    Background  = Brushes.LightGray,
                                    BorderBrush = Brushes.Transparent,
                                    Foreground  = Brushes.Black,
                                    FontWeight  = FontWeights.Bold,
                                    FontSize    = 12,
                                    Height      = 20
                                };
                                event1.Click += new RoutedEventHandler(Event1_Click);
                                EventControls.Children.Add(event1);
                            }
                        }
                    }
                }

                PreviewMedia.Source = new Uri(mediafile);
                ss             = settings;
                Volume.Value   = ss.Volume;
                mediaplaying   = mediaplay;
                returnposition = position;

                if (mediaplaying)
                {
                    PreviewMedia.Play();
                    mediaplaying = true;
                    timer.Start();
                    Play.Visibility   = Visibility.Hidden;
                    Pause.Visibility  = Visibility.Visible;
                    Pause2.Visibility = Visibility.Visible;
                }
                else
                {
                    mediaplaying = false;
                    timer.Stop();
                    Play.Visibility   = Visibility.Visible;
                    Pause.Visibility  = Visibility.Hidden;
                    Pause2.Visibility = Visibility.Hidden;
                }
            }
            catch (Exception ex)
            {
                this.Topmost = false;
                MessageBox.Show("Error initializing media fullcreen. - " + ex.Message);
                Error.WriteToLog(ex);
            }
        }