예제 #1
0
        private void NewImageBrush(bool editExisting)
        {
            FileBrowserControl control = new FileBrowserControl();
            PosDialogWindow    window  = new PosDialogWindow(control,
                                                             "Image Brush File Browser", 650, 440);

            PosDialogWindow.ShowPosDialogWindow(this, window);
            if (control.SelectedDirectoryEntry != null)
            {
                BitmapImage image = null;
                try
                {
                    image = new BitmapImage(
                        new Uri(control.SelectedDirectoryEntry.Fullpath, UriKind.Absolute));
                }
                catch (Exception)
                {
                    PosDialogWindow.ShowDialog(Window.GetWindow(this),
                                               "That is not a valid image file", "Error");
                }
                if (image != null)
                {
                    UserControl.SelectedBrush = new ImageBrush(image);
                }
            }
        }
예제 #2
0
        private void NewVisualBrush(bool p)
        {
            FileBrowserControl control = new FileBrowserControl();
            PosDialogWindow    window  = new PosDialogWindow(control,
                                                             "Video Brush File Browser", 650, 440);

            PosDialogWindow.ShowPosDialogWindow(this, window);
            if (control.SelectedDirectoryEntry != null)
            {
                MediaElement media = null;
                try
                {
                    media        = new MediaElement();
                    media.Source =
                        new Uri(control.SelectedDirectoryEntry.Fullpath, UriKind.Absolute);
                    //if (!media.HasVideo)
                    //    throw new Exception("Not a video");
                }
                catch (Exception)
                {
                    media = null;
                    PosDialogWindow.ShowDialog(Window.GetWindow(this),
                                               "That is not a valid video file", "Error");
                }
                if (media != null)
                {
                    UserControl.SelectedBrush = new VisualBrush(media);
                }
            }
        }
예제 #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.userControl = ((PosControls.FileBrowserControl)(target));

            #line 8 "..\..\FileBrowserControl.xaml"
                this.userControl.Loaded += new System.Windows.RoutedEventHandler(this.userControl_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.mainPane = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 3:
                this.Configuration = ((PosControls.ConfigurationManager)(target));
                return;

            case 4:
                this.gridControl = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.listView1 = ((System.Windows.Controls.ListView)(target));
                return;
            }
            this._contentLoaded = true;
        }