Beispiel #1
0
 // only stop if this node is current slide show
 public void MaybeStopSlideShow(SlideShow node)
 {
     if (node == slideShow) {
         slideShow.StopSlideShow();
         slideShow = null;
     }
 }
Beispiel #2
0
 // only start if this node isn't a slide show yet
 public void MaybeStartSlideShow(SlideShow node)
 {
     if (node != slideShow) {
         if (slideShow != null)
             slideShow.StopSlideShow();
         slideShow = node;
         slideShow.StartSlideShow( ShouldBalance );
     }
 }
 public async Task Load(string folderUrl, string url)
 {
     var rect = new Rect(0, 0, 500, 300);
     if (DownloadManager.IsImage(url))
     {
         slideShow = new SlideShow();
         await slideShow.SetRect(rect, folderUrl, url, 1f);
         progressLoad.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
         frame.Children.Add(slideShow);
     }
     else if (DownloadManager.IsVideo(url))
     {
         rect = new Rect(0, 0, Window.Current.Bounds.Width, Window.Current.Bounds.Height);
         videoPlayer = new VideoPlayer();
         videoPlayer.SetRect(rect, folderUrl, url, 1f);
         progressLoad.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
         frame.Children.Add(videoPlayer);
     }
 }
        public override void ApplyEditChanges()
        {
            try
            {
                if (_editPropertyImageSlideCollectionControl.UpdatedImageSlideShow.TrimmedNullOrEmpty())
                {
                    ImageSlideShow = SlideShow.Empty;
                    return;
                }

                var updatedImageSlideShow = JsonConvert.DeserializeObject<SlideShow>(_editPropertyImageSlideCollectionControl.UpdatedImageSlideShow, new IsoDateTimeConverter()) ?? SlideShow.Empty;
                updatedImageSlideShow.EnsureUniqueIds();
                ImageSlideShow = updatedImageSlideShow;
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                AddErrorValidator(ex.Message);
            }
        }
Beispiel #5
0
 public static SlideShow CreateSlideShow(int id)
 {
     SlideShow slideShow = new SlideShow();
     slideShow.ID = id;
     return slideShow;
 }
 private SlideShow GetData()
 {
     SlideShow data = null;
     if (lblId.Text != "")
         data = SlideShow.LayTheoID(lblId.Text);//cap nhat voi thong tin cu
     else
         data = new SlideShow();//them moi
     data.TieuDe_Vn = txtTieuDeVn.Text;
     data.HinhAnh = txtHinhAnh.Text;
     data.MoTa = txtMota.Text;
     data.ViTri = ConvertType.ToInt32(txtViTri.Text);
     data.HienThi = 1; // ConvertType.ToInt32(ddlLoadMenu.SelectedValue.Trim());
     return data;
 }
 private void SetData(SlideShow data)
 {
     lblId.Text = data.ID.ToString();
     txtTieuDeVn.Text = data.TieuDe_Vn;
     txtMota.Text = data.MoTa;
     txtHinhAnh.Text = data.HinhAnh;
     txtViTri.Text = data.ViTri.ToString();
     //ddlLoadMenu.SelectedValue = data.HienThi.ToString();
 }
		public void ShowSlides (string name)
		{
			SlideShow show = new SlideShow (name);
			Register (show.Window);
			GLib.Idle.Add (new GLib.IdleHandler (show.Execute));
		}
Beispiel #9
0
 /**
  * Set the SlideShow we're attached to.
  * Also passes it on to our child RichTextRuns
  */
 public void SetSlideShow(SlideShow ss) {
     _slideShow = ss;
     TextRun[] trs = GetTextRuns();
     if (trs != null) {
         for (int i = 0; i < trs.Length; i++) {
             trs[i].supplySlideShow(_slideShow);
         }
     }
 }
Beispiel #10
0
	/**
	 * Supply the SlideShow we belong to.
	 * Also passes it on to our child RichTextRuns
	 */
	public void supplySlideShow(SlideShow ss) {
		slideShow = ss;
		if(_rtRuns != null) {
			for(int i=0; i<_rtRuns.Length; i++) {
				_rtRuns[i].supplySlideShow(slideShow);
			}
		}
	}
Beispiel #11
0
    /**
     * Assign SlideShow for this slide master.
     * (Used interanlly)
     */
    public void SetSlideShow(SlideShow ss) {
        super.SetSlideShow(ss);

        //after the slide show is assigned collect all available style records
        if (_txmaster == null) {
            _txmaster = new TxMasterStyleAtom[9];

            TxMasterStyleAtom txdoc = GetSlideShow().GetDocumentRecord().GetEnvironment().GetTxMasterStyleAtom();
            _txmaster[txdoc.GetTextType()] = txdoc;

            TxMasterStyleAtom[] txrec = ((MainMaster)getSheetContainer()).GetTxMasterStyleAtoms();
            for (int i = 0; i < txrec.Length; i++) {
                _txmaster[txrec[i].GetTextType()] = txrec[i];
            }
        }
    }
Beispiel #12
0
        public void Start_TestEventhandlerWhenNull()
        {
            SlideShow s = new SlideShow(3, new ObservableCollection <MediaFile>());

            Assert.IsTrue(s.EventhandlerIsNull);
        }
Beispiel #13
0
        public FullScreenView(IBrowsableCollection collection, Gtk.Window parent) : base("Full Screen Mode")
        {
            //going fullscreen on the same screen the parent window
            Gdk.Screen screen  = Screen;
            int        monitor = screen.GetMonitorAtWindow(parent.GdkWindow);

            Gdk.Rectangle bounds = screen.GetMonitorGeometry(monitor);
            Move(bounds.X, bounds.Y);

            string style = "style \"test\" {\n" +
                           "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" +
                           "}\n" +
                           "class \"GtkToolbar\" style \"test\"";

            Gtk.Rc.ParseString(style);

            Name = "FullscreenContainer";
            try {
                //scroll = new Gtk.ScrolledWindow (null, null);
                actions = new ActionGroup("joe");

                actions.Add(new[] {
                    new ActionEntry(HideToolbar, Stock.Close, Strings.Hide, null, Strings.HideToolbar, HideToolbarAction)
                });

                actions.Add(new[] {
                    new ToggleActionEntry(Info, Stock.Info, Strings.Info, null, Strings.ImageInformation, InfoAction, false)
                });

                var exit_full_screen = new Gtk.Action(ExitFullScreen, Strings.ExitFullscreen, null, null)
                {
                    IconName = "view-restore"
                };
                exit_full_screen.Activated += ExitAction;
                actions.Add(exit_full_screen);

                var slide_show = new Gtk.Action(SlideShow, Strings.Slideshow, Strings.StartSlideshow, null)
                {
                    IconName = "media-playback-start"
                };
                slide_show.Activated += SlideShowAction;
                actions.Add(slide_show);

                new WindowOpacityFader(this, 1.0, 600);
                notebook = new Notebook {
                    ShowBorder = false,
                    ShowTabs   = false
                };
                notebook.Show();

                scroll = new ScrolledView();
                scroll.ScrolledWindow.SetPolicy(PolicyType.Never, PolicyType.Never);
                View = new PhotoImageView(collection);
                // FIXME this should be handled by the new style setting code
                View.ModifyBg(Gtk.StateType.Normal, this.Style.Black);
                Add(notebook);
                View.Show();
                View.MotionNotifyEvent += HandleViewMotion;
                View.PointerMode        = PointerMode.Scroll;

                scroll.ScrolledWindow.Add(View);

                var tbar = new Toolbar {
                    ToolbarStyle = Gtk.ToolbarStyle.BothHoriz,

                    ShowArrow   = false,
                    BorderWidth = 15
                };

                var t_item = actions[ExitFullScreen].CreateToolItem() as ToolItem;
                t_item.IsImportant = true;
                tbar.Insert(t_item, -1);

                Gtk.Action action = new PreviousPictureAction(View.Item);
                actions.Add(action);
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);

                play_pause_button = actions[SlideShow].CreateToolItem() as ToolButton;
                tbar.Insert(play_pause_button, -1);

                action = new NextPictureAction(View.Item);
                actions.Add(action);
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);

                t_item = new ToolItem {
                    Child = new Label(Strings.SlideTransitionColon)
                };
                tbar.Insert(t_item, -1);

                display = new SlideShow(View.Item);
                display.AddEvents((int)Gdk.EventMask.PointerMotionMask);
                display.ModifyBg(Gtk.StateType.Normal, Style.Black);
                display.MotionNotifyEvent += HandleViewMotion;
                display.Show();

                t_item = new ToolItem();
                ComboBox combo = ComboBox.NewText();
                foreach (var transition in display.Transitions)
                {
                    combo.AppendText(transition.Name);
                }

                combo.Active   = 0;
                combo.Changed += HandleTransitionChanged;
                t_item.Child   = combo;
                tbar.Insert(t_item, -1);

                action = new RotateLeftAction(View.Item);
                actions.Add(action);
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);

                action = new RotateRightAction(View.Item);
                actions.Add(action);
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);

                info_button = (ToggleToolButton)(actions[Info].CreateToolItem() as ToolItem);
                tbar.Insert(info_button, -1);

                tbar.Insert(actions[HideToolbar].CreateToolItem() as ToolItem, -1);

                notebook.AppendPage(scroll, null);
                notebook.AppendPage(display, null);

                tbar.ShowAll();

                scroll.Show();
                Decorated = false;
                Fullscreen();
                ButtonPressEvent += HandleButtonPressEvent;

                View.Item.Changed += HandleItemChanged;
                View.GrabFocus();

                //hide_cursor_delay = new DelayedOperation (3000, new GLib.IdleHandler (HideCursor));
                //hide_cursor_delay.Start ();

                controls = new ControlOverlay(this);
                controls.Add(tbar);
                controls.Dismiss();

                notebook.CurrentPage = 0;
            } catch (Exception e) {
                Log.Exception(e);
            }
        }
Beispiel #14
0
        public IActionResult Add()
        {
            var slideShow = new SlideShow();

            return(View("Add", slideShow));
        }
Beispiel #15
0
 public void AddToSlideShows(SlideShow slideShow)
 {
     base.AddObject("SlideShows", slideShow);
 }
        private SlideShow CreateExampleSlideShow(int accountid, string slideshowname, string tags, List<Image> images)
        {
            try
            {
                ISlideShowRepository slideshowrep = new EntitySlideShowRepository();
                SlideShow slideshow = new SlideShow();
                slideshow.AccountID = accountid;
                slideshow.SlideShowName = slideshowname;
                slideshow.Tags = tags;
                slideshow.TransitionType = "Fade";
                slideshow.IntervalInSecs = 10;
                slideshow.IsActive = true;
                slideshowrep.CreateSlideShow(slideshow);

                ISlideShowImageXrefRepository ssixrefrep = new EntitySlideShowImageXrefRepository();
                int i = 1;
                foreach (Image image in images)
                {
                    SlideShowImageXref xref = new SlideShowImageXref();
                    xref.PlayOrder = i;
                    xref.SlideShowID = slideshow.SlideShowID;
                    xref.ImageID = image.ImageID;
                    ssixrefrep.CreateSlideShowImageXref(xref);
                    i += 1;
                }

                return slideshow;
            }
            catch { return null; }
        }
        public FullScreenView(IBrowsableCollection collection, Gtk.Window parent)
            : base("Full Screen Mode")
        {
            //going fullscreen on the same screen the parent window
            Gdk.Screen screen = Screen;
            int monitor = screen.GetMonitorAtWindow (parent.GdkWindow);
            Gdk.Rectangle bounds = screen.GetMonitorGeometry (monitor);
            Move (bounds.X, bounds.Y);

            string style = "style \"test\" {\n" +
                "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" +
                "}\n" +
                "class \"GtkToolbar\" style \"test\"";

            Gtk.Rc.ParseString (style);

            Name = "FullscreenContainer";
            try {
                //scroll = new Gtk.ScrolledWindow (null, null);
                actions = new ActionGroup ("joe");

                actions.Add (new ActionEntry [] {
                    new ActionEntry (HideToolbar, Stock.Close,
                             Catalog.GetString ("Hide"),
                             null,
                             Catalog.GetString ("Hide toolbar"),
                             HideToolbarAction)});

                actions.Add (new ToggleActionEntry [] {
                    new ToggleActionEntry (Info,
                                   Stock.Info,
                                   Catalog.GetString ("Info"),
                                   null,
                                   Catalog.GetString ("Image information"),
                                   InfoAction,
                                   false)});

                Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen,
                    Catalog.GetString ("Exit fullscreen"),
                    null,
                    null);
                exit_full_screen.IconName = "view-restore";
                exit_full_screen.Activated += ExitAction;
                actions.Add (exit_full_screen);

                Gtk.Action slide_show = new Gtk.Action (SlideShow,
                    Catalog.GetString ("Slideshow"),
                    Catalog.GetString ("Start slideshow"),
                    null);
                slide_show.IconName = "media-playback-start";
                slide_show.Activated += SlideShowAction;
                actions.Add (slide_show);

                new WindowOpacityFader (this, 1.0, 600);
                notebook = new Notebook ();
                notebook.ShowBorder = false;
                notebook.ShowTabs = false;
                notebook.Show ();

                scroll = new ScrolledView ();
                scroll.ScrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Never);
                view = new PhotoImageView (collection);
                // FIXME this should be handled by the new style setting code
                view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
                this.Add (notebook);
                view.Show ();
                view.MotionNotifyEvent += HandleViewMotion;
                view.PointerMode = PointerMode.Scroll;

                scroll.ScrolledWindow.Add (view);

                Toolbar tbar = new Toolbar ();
                tbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;

                tbar.ShowArrow = false;
                tbar.BorderWidth = 15;

                ToolItem t_item = (actions [ExitFullScreen]).CreateToolItem () as ToolItem;
                t_item.IsImportant = true;
                tbar.Insert (t_item, -1);

                Gtk.Action action = new PreviousPictureAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                play_pause_button = (actions [SlideShow]).CreateToolItem () as ToolButton;
                tbar.Insert (play_pause_button, -1);

                action = new NextPictureAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                t_item = new ToolItem ();
                t_item.Child = new Label (Catalog.GetString ("Slide transition:"));
                tbar.Insert (t_item, -1);

                display = new SlideShow (view.Item);
                display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
                display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
                display.MotionNotifyEvent += HandleViewMotion;
                display.Show ();

                t_item = new ToolItem ();
                ComboBox combo = ComboBox.NewText ();
                foreach (var transition in display.Transitions)
                    combo.AppendText (transition.Name);
                combo.Active = 0;
                combo.Changed += HandleTransitionChanged;
                t_item.Child = combo;
                tbar.Insert (t_item, -1);

                action = new RotateLeftAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                action = new RotateRightAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                info_button = (ToggleToolButton) ((actions [Info]).CreateToolItem () as ToolItem);
                tbar.Insert (info_button, -1);

                tbar.Insert ((actions [HideToolbar]).CreateToolItem () as ToolItem, -1);

                notebook.AppendPage (scroll, null);
                notebook.AppendPage (display, null);

                tbar.ShowAll ();

                scroll.Show ();
                this.Decorated = false;
                this.Fullscreen ();
                this.ButtonPressEvent += HandleButtonPressEvent;

                view.Item.Changed += HandleItemChanged;
                view.GrabFocus ();

                hide_cursor_delay = new DelayedOperation (3000, new GLib.IdleHandler (HideCursor));
                hide_cursor_delay.Start ();

                controls = new ControlOverlay (this);
                controls.Add (tbar);
                controls.Dismiss ();

                notebook.CurrentPage = 0;
            } catch (System.Exception e) {
                Log.Exception (e);
            }
        }
Beispiel #18
0
 public HeadersFooters(HeadersFootersContainer rec, SlideShow ppt, bool newRecord, bool IsPpt2007){
     _Container = rec;
     _newRecord = newRecord;
     _ppt = ppt;
     _ppt2007 = isPpt2007;
 }
Beispiel #19
0
 public async Task <IViewComponentResult> InvokeAsync(SlideShow model)
 {
     return(await Task.Run(() => View(model)));
 }