Beispiel #1
0
    // Use this for initialization
    void Awake()
    {
        Canvas = transform.GetChild(0);
        Layout = GetComponent <Layout>();

        Transform ContentWindow = Canvas.GetChild(0).GetChild(0).GetChild(0);

        foreach (OutreachBlock block in Layout.OutreachContent)
        {
            GameObject Entry     = Instantiate(Resources.Load("Prefabs/Layouts/Community Outreach/Entry"), ContentWindow) as GameObject;
            Slideshow  slideshow = Entry.GetComponentInChildren <Slideshow>();

            if (block.Slides.Length > 0)
            {
                slideshow.Slides = block.Slides;
            }

            else
            {
                slideshow.gameObject.SetActive(false);
            }
            Text[] fields = Entry.GetComponentsInChildren <Text>();

            Text header = fields[0];
            header.text = block.Header;

            Text description = fields[1];
            description.text = block.Description;
        }
    }
Beispiel #2
0
        private static ISlideshow LoadSlides(string inputUrl, Func <slideshowSlideContent, ISlideSection, IContent> factoryLoader)
        {
            JabberPoint.Data.slideshow   data;
            JabberPoint.Domain.Slideshow slideshow;

            SlideshowXmlLoader loader = new SlideshowXmlLoader(inputUrl);

            data = loader.RootObject;

            slideshow = new Slideshow();

            foreach (var dataslide in data.slides)
            {
                ISlideSection slide = new SlideSection(slideshow);
                slideshow.Slides.Add(slide);

                foreach (var datacontent in dataslide.contents)
                {
                    slide.Contents.Add(slide.Contents.Count, factoryLoader(datacontent, slide));
                }
            }

            SetMetaData(slideshow, data.metainfos);

            return(slideshow);
        }
Beispiel #3
0
        ///////////////////////////////////////////////////////////////////////////////
        // Public methods                                                            //
        ///////////////////////////////////////////////////////////////////////////////
        #region PUBLICMETHODS
        #endregion //PUBLICMETHODS

        ///////////////////////////////////////////////////////////////////////////////
        // Inherited methods                                                         //
        ///////////////////////////////////////////////////////////////////////////////
        #region OVERRIDES

        /// <summary>
        /// Initialize custom elements
        /// </summary>
        protected override void InitializeCustomElements()
        {
            base.InitializeCustomElements();
            this.slideshow          = new Slideshow();
            this.toolTip            = new ToolTip();
            this.toolTip.ShowAlways = true;

            if (SecondaryScreen.SystemHasSecondaryScreen())
            {
                if (Settings.Default.PresentationScreenMonitor == "Primary")
                {
                    this.btnPrimary.Checked   = true;
                    this.btnSecondary.Checked = false;
                }
                else
                {
                    this.btnPrimary.Checked   = false;
                    this.btnSecondary.Checked = true;
                }
            }
            else
            {
                this.btnPrimary.Visible   = false;
                this.btnSecondary.Visible = false;
            }

            // Hide PropertyGrid
            this.spcPropertiesPreview.Panel1Collapsed = true;

            this.btnHelp.Click    += new EventHandler(this.btnHelp_Click);
            this.pnlCanvas.Resize += new EventHandler(this.pnlCanvas_Resize);
        }
Beispiel #4
0
    private void DisplayTimelapse(RetiredColonyData data, GameObject container)
    {
        RectTransform reference = container.GetComponent <HierarchyReferences>().GetReference <RectTransform>("PlayIcon");

        slideshow            = container.GetComponent <HierarchyReferences>().GetReference <Slideshow>("Slideshow");
        slideshow.updateType = SlideshowUpdateType.loadOnDemand;
        slideshow.SetPaused(true);
        slideshow.onBeforePlay = delegate
        {
            LoadSlideshow(data);
        };
        slideshow.onEndingPlay = delegate
        {
            LoadScreenshot(data);
        };
        if (!LoadScreenshot(data))
        {
            slideshow.gameObject.SetActive(false);
            reference.gameObject.SetActive(false);
        }
        else
        {
            slideshow.gameObject.SetActive(true);
            reference.gameObject.SetActive(true);
        }
    }
Beispiel #5
0
        public ActionResult Create([Bind(Include = "Id,Image1,Image2,Image3,Image4")] Slideshow slideshow, HttpPostedFileBase PictureUpload1, HttpPostedFileBase PictureUpload2, HttpPostedFileBase PictureUpload3, HttpPostedFileBase PictureUpload4)
        {
            string Dates = DateTime.Now.ToString("ddMMyyyy-hhmmss");

            if (ModelState.IsValid)
            {
                if (PictureUpload1 != null)
                {
                    PictureUpload1.SaveAs(Server.MapPath("~/Areas/Admin/Content/ImageAds/") + Dates + "_" + PictureUpload1.FileName);
                    slideshow.Image1 = Dates + "_" + PictureUpload1.FileName;
                }
                if (PictureUpload2 != null)
                {
                    PictureUpload2.SaveAs(Server.MapPath("~/Areas/Admin/Content/ImageAds/") + Dates + "_" + PictureUpload2.FileName);
                    slideshow.Image2 = DateTime.Now.ToString("ddMMyyyy-hhmmss") + "_" + PictureUpload2.FileName;
                }
                if (PictureUpload3 != null)
                {
                    PictureUpload3.SaveAs(Server.MapPath("~/Areas/Admin/Content/ImageAds/") + Dates + "_" + PictureUpload3.FileName);
                    slideshow.Image3 = Dates + "_" + PictureUpload3.FileName;
                }
                if (PictureUpload4 != null)
                {
                    PictureUpload4.SaveAs(Server.MapPath("~/Areas/Admin/Content/ImageAds/") + Dates + "_" + PictureUpload4.FileName);
                    slideshow.Image4 = Dates + "_" + PictureUpload4.FileName;
                }

                db.Slideshows.Add(slideshow);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(slideshow));
        }
        public Task PutSimpleXML() => TestStatus(async(host, pipeline) =>
        {
            var slideshow    = new Slideshow();
            slideshow.Author = "Yours Truly";
            slideshow.Date   = "Date of publication";
            slideshow.Title  = "Sample Slide Show";

            slideshow.Slides = new List <Slide>()
            {
                new Slide()
                {
                    Title = "Wake up to WonderWidgets!",
                    Type  = "all"
                },
                new Slide()
                {
                    Title = "Overview",
                    Type  = "all",
                    Items = new[]
                    {
                        "Why WonderWidgets are great",
                        "",
                        "Who buys WonderWidgets"
                    }
                }
            };

            return(await new XmlClient(ClientDiagnostics, pipeline, host).PutSimpleAsync(slideshow));
        });
Beispiel #7
0
        ///////////////////////////////////////////////////////////////////////////////
        // Construction and Initializing methods                                     //
        ///////////////////////////////////////////////////////////////////////////////
        #region CONSTRUCTION

        /// <summary>
        /// Initializes a new instance of the ExperimentSettings class.
        /// </summary>
        public ExperimentSettings()
        {
            this.widthStimulusScreen          = 1024;
            this.heightStimulusScreen         = 768;
            this.documentPath                 = string.Empty;
            this.experimentName               = string.Empty;
            this.sqlInstanceName              = "SQLEXPRESS";
            this.gazeSamplingRate             = 60;
            this.mouseSamplingRate            = 10;
            this.gazeMaxDistance              = 20;
            this.mouseMaxDistance             = 20;
            this.gazeMinSamples               = 5;
            this.mouseMinSamples              = 10;
            this.gazeDiameterDiv              = 2;
            this.mouseDiameterDiv             = 5;
            this.fixationRingSize             = 31;
            this.mergeConsecutiveFixations    = true;
            this.eliminateFirstFixation       = false;
            this.limitForFirstFixation        = 300;
            this.eliminateFirstFixationSimple = false;
            this.slideShow = new Slideshow();
            this.customConnectionString = string.Empty;
            this.gazeColorParams        = new ColorizationParameters();
            this.mouseColorParams       = new ColorizationParameters();
            this.ogamaVersion           = new Version(); // Assembly.GetExecutingAssembly().GetName().Version;
            this.ScreenCaptureFramerate = 10;
        }
        public ActionResult SaveSlide(string imgurl, string url, int?displayorder, int?status, int?id, string video)
        {
            var dataslide = db.Slideshows.Where(x => x.id == id).FirstOrDefault();

            if (dataslide == null)
            {
                dataslide              = new Slideshow();
                dataslide.imgurl       = imgurl;
                dataslide.videoembed   = video.Replace("watch?v=", "embed/");
                dataslide.url          = url;
                dataslide.displayorder = displayorder;
                dataslide.status       = status;
                db.Slideshows.Add(dataslide);
                db.SaveChanges();
                return(Json(1));
            }
            else
            {
                dataslide.imgurl       = imgurl;
                dataslide.url          = url;
                dataslide.displayorder = displayorder;
                dataslide.videoembed   = video.Replace("watch?v=", "embed/");
                dataslide.status       = status;
                db.SaveChanges();
                return(Json(1));
            }
        }
 internal static SlideshowModel From(Slideshow slideshow)
 {
     return new SlideshowModel()
     {
         SlideshowId = slideshow.Id,
         Name = slideshow.Name
     };
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Slideshow slideshow = db.Slideshows.Find(id);

            db.Slideshows.Remove(slideshow);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #11
0
        public IActionResult Index()
        {
            var builder = new ConfigurationBuilder().SetBasePath(_appEnvironment.WebRootPath).AddJsonFile("img/images.txt");
            IConfigurationRoot Configuration = builder.Build();
            Slideshow          show          = new Slideshow(Configuration);

            return(View(show));
        }
 private bool IsNewSlideshowToDisplay(Slideshow newSlideshow)
 {
     if (Slideshow == null)
     {
         return true;
     }
     bool isNewSlideshowToDisplay = !Slideshow.Equals(newSlideshow);
     return isNewSlideshowToDisplay;
 }
        public Task PutEmptyXMLList() => TestStatus(async(host, pipeline) =>
        {
            var root = new Slideshow
            {
                Slides = new List <Slide>()
            };

            return(await new XmlClient(ClientDiagnostics, pipeline, host).PutEmptyListAsync(root));
        });
 /// <summary>
 /// Load a slideshow. The SlideshowLoaded event will fire when it is done.
 /// </summary>
 /// <param name="file"></param>
 void loadSlideshow(String file)
 {
     standaloneController.DocumentController.addToRecentDocuments(editorController.ResourceProvider.BackingLocation);
     slideshow = editorController.loadFile <Slideshow>(file);
     if (updateSmartLecture())
     {
         finishLoadingSlideshow();
     }
 }
Beispiel #15
0
        public void Update(Slideshow s)
        {
            var slide = db.Slideshows.SingleOrDefault(ss => ss.ID == s.ID);

            slide.ImagePath     = s.ImagePath;
            slide.ThumbnailPath = s.ThumbnailPath;
            slide.Link          = s.Link;
            slide.Status        = s.Status;
            db.SubmitChanges();
        }
Beispiel #16
0
        public void startSlideshow(object sender, RoutedEventArgs evt)
        {
            Item      screenData = (Item)ScreenSelector.SelectedItem;
            Slideshow slideshow  = new Slideshow();

            slideshow.WindowStartupLocation = WindowStartupLocation.Manual;
            slideshow.Left = screenData.X;
            slideshow.Top  = screenData.Y;
            slideshow.Show();
        }
Beispiel #17
0
        /// <summary>
        /// Saves the current slides collection to a OGAMA slideshow file.
        /// </summary>
        /// <param name="filePath">Path to slideshow file.</param>
        /// <returns><strong>True</strong> if successful,
        /// otherwise <strong>false</strong>.</returns>
        private DialogResult SaveSlideshowToFile(string filePath)
        {
            try
            {
                if (this.trvSlideshow.Nodes[0].Nodes.Count == 0)
                {
                    return(DialogResult.Cancel);
                }

                using (TextWriter writer = new StreamWriter(filePath))
                {
                    string message = "Would you like to export the whole slideshow ?" +
                                     Environment.NewLine + "Otherwise only the selected tree node will be exported";
                    DialogResult result = InformationDialog.Show("Save whole slideshow ?", message, true, MessageBoxIcon.Question);

                    switch (result)
                    {
                    case DialogResult.Cancel:
                        return(DialogResult.Cancel);

                    case DialogResult.No:
                        // Create an instance of the XmlSerializer class;
                        // specify the type of object to serialize
                        XmlSerializer     serializer  = new XmlSerializer(typeof(SlideshowTreeNode));
                        SlideshowTreeNode currentNode = this.slideshow;
                        if (this.trvSlideshow.SelectedNodes.Count > 0)
                        {
                            currentNode = (SlideshowTreeNode)this.trvSlideshow.SelectedNodes[0];
                        }

                        // Serialize the Nodes
                        serializer.Serialize(writer, currentNode);
                        break;

                    case DialogResult.Yes:
                        // Create an instance of the XmlSerializer class;
                        // specify the type of object to serialize
                        serializer = new XmlSerializer(typeof(Slideshow));
                        Slideshow currentSlideshow = this.slideshow;

                        // Serialize the Nodes
                        serializer.Serialize(writer, currentSlideshow);
                        return(DialogResult.OK);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionMethods.HandleException(ex);

                return(DialogResult.Abort);
            }

            return(DialogResult.OK);
        }
Beispiel #18
0
 /// <summary>
 /// Default constructor that takes an instance of Album to show all its content in a slideshow.
 /// </summary>
 /// <param name="a"></param>
 ///
 public SlideshowWindow(Slideshow s)
 {
     InitializeComponent();
     slideshow            = s;
     this.PreviewKeyDown += new KeyEventHandler(EscButtonHandler); //listener to ESC button to skip the slideshow and close the window
     if (slideshow.SlideshowItems.Count > 0)
     {
         currentIndex = 0;
         ShowMediaFileAtIndex(currentIndex);
     }
 }
    void BuildMainMenuUI()
    {
        // Setup slideshow
        m_slideTarget        = GameObject.Find("SlideTarget").GetComponent <RawImage>();
        m_slideshow          = new Slideshow(m_slideTarget, TextureManager.GetBackgrounds(), true);
        m_slideshow.FadeTime = SLIDE_FADE_TIME;
        m_slideshow.AutoPlay(SLIDE_DURATION);

        // Main Menu
        GameObject.Find("MenuPanel").GetComponent <RawImage>().texture = TextureManager.Get("main_menu_panel");
    }
 /// <summary>
 /// Submits given <see cref="Slideshow"/> to the <see cref="TreeView"/> <see cref="trvSlideshow"/>.
 /// </summary>
 /// <param name="slideshow">A <see cref="Slideshow"/> with the slides to import.</param>
 private void PopulateTreeView(Slideshow slideshow)
 {
     this.Cursor = Cursors.WaitCursor;
     this.trvSlideshow.BeginUpdate();
     this.trvSlideshow.Nodes.Clear();
     this.trvSlideshow.Nodes.Add(slideshow);
     this.trvSlideshow.EndUpdate();
     this.trvSlideshow.ExpandAll();
     this.trvSlideshow.Nodes[0].EnsureVisible();
     this.Cursor = Cursors.Default;
 }
 public ActionResult Edit([Bind(Include = "SlideID,ImageID,SlideLink,Display,SlideOrder")] Slideshow slideshow)
 {
     if (ModelState.IsValid)
     {
         db.Entry(slideshow).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ImageID = new SelectList(db.Images, "ImageID", "ImageName", slideshow.ImageID);
     return(View(slideshow));
 }
Beispiel #22
0
        ///////////////////////////////////////////////////////////////////////////////
        // Eventhandler for Custom Defined Events                                    //
        ///////////////////////////////////////////////////////////////////////////////
        #region CUSTOMEVENTHANDLER
        #endregion //CUSTOMEVENTHANDLER

        #endregion //EVENTS

        ///////////////////////////////////////////////////////////////////////////////
        // Methods and Eventhandling for Background tasks                            //
        ///////////////////////////////////////////////////////////////////////////////
        #region BACKGROUNDWORKER
        #endregion //BACKGROUNDWORKER

        ///////////////////////////////////////////////////////////////////////////////
        // Methods for doing main class job                                          //
        ///////////////////////////////////////////////////////////////////////////////
        #region PRIVATEMETHODS

        /// <summary>
        /// This method populates the dialogs <see cref="TreeView"/>
        /// with the given slideshow.
        /// </summary>
        /// <param name="slideshow">The <see cref="Slideshow"/> to be used.</param>
        private void PopulateTreeview(Slideshow slideshow)
        {
            Slideshow clone = (Slideshow)slideshow.Clone();

            clone.Remove();
            this.trvSlideshow.BeginUpdate();
            this.trvSlideshow.Nodes.Clear();
            this.trvSlideshow.Nodes.Add(clone);
            this.trvSlideshow.EndUpdate();
            this.trvSlideshow.ExpandAll();
        }
Beispiel #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.ParentID > 0)
            {
                Slideshow slideshow = new Slideshow(new SiteData().ConnectionString);
                slideshow.ParentID    = this.ParentID;
                slideshow.LoadDefault = this.LoadDefault;
                slideshow.Load();

                rptSlideshow.DataSource = slideshow.Banners;
                rptSlideshow.DataBind();
            }
        }
Beispiel #24
0
    // Use this for initialization
    IEnumerator Start()
    {
        show       = GetComponent <Slideshow>();
        mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        txt        = mainCamera.GetComponentInChildren <Text>();
        yield return(new WaitForSeconds(0.5f));

        show.ShowCutscene();
        StartCoroutine("Checker");
        StartCoroutine("Writer");
        finishedWrite = false;
        finishedMov   = false;
    }
Beispiel #25
0
 public virtual Response PutEmptyList(Slideshow slideshow, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("XmlClient.PutEmptyList");
     scope.Start();
     try
     {
         return(RestClient.PutEmptyList(slideshow, cancellationToken));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
        public SlideshowModel Create(Slideshow slideshow)
        {
            SlideshowModel model = new SlideshowModel();

            model.Id          = slideshow.slideshow_id;
            model.Url         = _urlHelper.Link("slideshow", new { slideshowid = slideshow.slideshow_id });
            model.Description = slideshow.description;
            model.Title       = slideshow.slideshow_title;
            model.Producer    = slideshow.producer;
            model.LastUpdated = slideshow.last_updated;

            //Slides = slideshow.Slides.Select(s => Create(s))
            return(model);
        }
Beispiel #27
0
 public virtual async Task <Response> PutEmptyListAsync(Slideshow slideshow, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("XmlClient.PutEmptyList");
     scope.Start();
     try
     {
         return(await RestClient.PutEmptyListAsync(slideshow, cancellationToken).ConfigureAwait(false));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
        // GET: Slideshow/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Slideshow slideshow = db.Slideshows.Find(id);

            if (slideshow == null)
            {
                return(HttpNotFound());
            }
            return(View(slideshow));
        }
        // GET: Slideshow/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Slideshow slideshow = db.Slideshows.Find(id);

            if (slideshow == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ImageID = new SelectList(db.Images, "ImageID", "ImageName", slideshow.ImageID);
            return(View(slideshow));
        }
        public ActionResult Index(GalleryForSlideshow galleryForSlideshow)
        {
            if (ModelState.IsValid)
            {
                Gallery gallery = galleriesRepository.Galleries.Find(galleryForSlideshow.SelectedId);

                FolderResolver folderResolver = new FolderResolver(gallery.Path);

                Slideshow slideshow = new Slideshow();
                slideshow.SetImagesForSlideshow(folderResolver.ImagesDirectory);

                return(RedirectToAction("Index", "Manager"));
            }

            return(View("Index"));
        }
        public override FrameworkElement Draw(int pageNr)
        {
            var themeManager   = JabberPoint.Domain.Themes.Themes.GetSingleton();
            var levelBehaviour = this.Parent.GetBehaviour <ILevelledBehaviour>();
            var style          = themeManager.GetStyle(pageNr, levelBehaviour.Level);

            return(new System.Windows.Controls.TextBlock()
            {
                Text = Slideshow.ReplaceTextWithMetaData(Text).Replace("[PageNr]", pageNr.ToString()),
                FontSize = style.FontSize,
                FontFamily = new System.Windows.Media.FontFamily(style.Font),
                FontStyle = style.FontStyle.HasFlag(JabberPoint.Domain.Helpers.FontStyle.Italic) ? FontStyles.Italic : FontStyles.Normal,
                FontWeight = style.FontWeight.HasFlag(JabberPoint.Domain.Helpers.FontWeight.Bold) ? FontWeights.Bold : FontWeights.Normal,
                Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom(style.FontColor))
            });
        }
Beispiel #32
0
        public SlideshowButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                TheButton.PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(SlideshowButtonBrush);
                TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(SlideshowButtonBrush, true);
                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(SlideshowButtonBrush, false);
                TheButton.Click      += delegate { UC.Close_UserControls(); Slideshow.StartSlideshow(); };

                var s = Application.Current.Resources["StartSlideshow"] as string;
                s      += " [F5]";
                ToolTip = s;
            };
        }
 public static SignboardHealth From(SignboardState state, bool isShowingScreensaver, Slideshow slideshow, float fontFactor) 
 {
     return new SignboardHealth()
     {
         ScreenState = state.ToString(),
         IsShowingScreensaver = isShowingScreensaver,
         FontFactor = fontFactor,
         SlideHealth = slideshow == null ? null : slideshow.Slides.Select(x =>
             new SlideHealth()
             {
                 SlideIndex = slideshow.Slides.IndexOf(x),
                 WidgetHealth = x.Widgets.Select(y => 
                     new WidgetHealth() 
                     { 
                         WidgetState = y.State.ToString(),
                         WidgetType = y.Type.ToString()
                     }).ToList()
             }).ToList()
     };
 }
        public IHttpActionResult Post(Guid companyId, SlideshowInputModel model)
        {
            if (companyId == null)
            {
                return NotFound();
            }

            if (String.IsNullOrWhiteSpace(model.Name))
            {
                return BadRequest("Invalid name for Slideshow.");
            }

            if (SlideshowRepository.GetByCompany(companyId).Any(s => s.Name.Equals(model.Name)))
            {
                return BadRequest("A slideshow with name '" + model.Name + "' already exists.");
            }

            Slideshow slideshow = new Slideshow(model.Name, companyId);

            SlideshowRepository.Add(slideshow);

            return Created(new Uri(Url.Link("GetSlideshow", new { companyId = slideshow.CompanyId, slideshowId = slideshow.Id })), SlideshowModel.From(slideshow));
        }
        /// <summary>
        /// Code that runs after the Form is created but before the Form is Displayed.
        /// </summary>
        private void ScreenSaverForm_Load(object sender, EventArgs e)
        {
            // Scot, this runs immediately after the constructor (well, almost. There are events which can come in
            // between constructor and Load - resize events, etc). Here we prep and initialize everything before we show the Form.
            // After that, it's all a matter of reacting to events (clicks, keypresses, timers, etc).

            // set debug output controls
            bool fDebugOutput = true;
            bool fDebugoutputTraceLevel = false;
            bool fDebugTrace = fDebugOutput && fDebugoutputTraceLevel;

            Logging.LogLineIf(fDebugTrace, "ScreenSaverForm_Load(): entered.");

            // set state flags
            fFormLoadIsRunning = true;

            // create the slideshow object, set its properties
            ourSlideshow = new Slideshow(this);
            ourSlideshow.IntervalInMilliSeconds = SettingsInfo.SlideshowIntervalInSecs * 1000;
            ourSlideshow.DeferralTimeWindowInMilliseconds = 1500;
            ourSlideshow.DeferralIntervalInMilliseconds = ourSlideshow.IntervalInMilliSeconds;

            // set the style of our window (maximized, topmost, etc) appropriately
            Logging.LogLineIf(fDebugTrace, "   ScreenSaverForm_Load(): entering or exiting ScreenSaverWindowStyle, as appropriate.");

            if (EntryPoint.fOpenInScreenSaverMode)
            {
                EnterScreenSaverWindowStyle();
            }
            else
            {
                ExitScreenSaverWindowStyle(true);       // restore us to "normal" using the size/position data from Settings
            }

            // point a public field to our picturebox, so that through this field the pb can be addressed by other forms (settings, for example)
            refto_pbMainPhoto = pbMain;

            // create a public font dialog that we can access from this and other forms
            fontdlg = new FontDialog();

            // set the base font dialog properties
            fontdlg.ShowColor = true;
            fontdlg.ShowEffects = true;
            fontdlg.ShowApply = true;
            fontdlg.FontMustExist = true;

            // set the specific font dialog properties to match the current font data in metaFontData
            FormatFontDialogFromFontData(metaFontData);

            // bind the event raised by the Font Dialog Apply Button to our handler
            fontdlg.Apply += new System.EventHandler(FontDialog_Apply);

            // Create the Color Picker Dialog - removed for bugs.  Will restore later.
            // colordlg = new ColorDialog();

            // bind the MouseWheel event (can't be done from VS Designer UI)
            MouseWheel += ScreenSaverForm_MouseWheel;

            // add the context menu to our form
            this.ContextMenuStrip = contextMenuMain;

            // set title of window
            this.Text = ProductName;

            // show a picture immediately;
            // create the MainFiles object - this leaves the index pointed at -1
            Logging.LogLineIf(fDebugTrace, "   ScreenSaverForm_Load(): creating MainFiles, should kick off disk scan.");
            MainFiles = new MainFileInfoSource(
                (List<DirectoryInfo>)SettingsInfo.GetListOfDirectoryInfo(),
                this.GraphicFileExtensions,
                SettingsInfo.GetBlacklistedFullFilenames(),
                SettingsInfo.UseRecursion,
                SettingsInfo.ShuffleMode);

            // advance one file; this leaves the index pointed at zero
            Logging.LogLineIf(fDebugTrace, "   ScreenSaverForm_Load(): calling DoPreviousOrNext(false).");
            DoPreviousOrNext(false);

            // if we opened in screen saver mode, start the slideshow
            if (EntryPoint.fOpenInScreenSaverMode) ourSlideshow.Start();

            // set state flags
            fFormLoadIsRunning = false;
            fFormLoadHasCompleted = true;

            Logging.LogLineIf(fDebugTrace, "ScreenSaverForm_Load(): exiting.");
        }
Beispiel #36
0
 private void OnSlideshow(object sender, System.EventArgs e)
 {
     if (_slideshow != null)
     {
         // stop slideshow
         _slideshow.Stop();
         _slideshow = null;
         paneImage.Box.UseTransition = false;
     }
     else
     {
         // start slideshow
         paneImage.Box.UseTransition = true;
         _slideshow = new Slideshow(_msSlideshowInterval, _nav);
         _slideshow.Start();
     }
 }
        private StructureResponseModel GetStructureResponseModel(Slideshow slideshow, List<AnnouncementResponseModel> announcementResponseModel, List<RequestResponseModel> signboardRequests, bool isShowingScreensaver, float fontFactor)
        {
            var returnVal = new StructureResponseModel()
            {
                Slideshow = slideshow == null ? null :
                new SlideshowResponseModel()
                {
                    Slides = slideshow.Slides.Where(x => x.IsActive && !x.IsDeleted).Select(slide => new SlideResponseModel()
                    {
                        BackgroundColour = slide.BackgroundColour.ColourHex,
                        DurationInSeconds = slide.Duration.Seconds,
                        Widgets = slide.Widgets.Select(widget =>
                            new WidgetResponseModel()
                            {
                                Type = GetWidgetDefinitionType(widget),
                                // Assumption: Widgets are all fullscreen
                                Position = new WidgetPositionResponseModel()
                                {
                                    StartColumnWeight = 0.0f,
                                    StartRowWeight = 0.0f,
                                    EndColumnWeight = 1.0f,
                                    EndRowWeight = 1.0f
                                },
                                Parameters = widget.Parameters.Select(parameter => new ParameterResponseModel()
                                {
                                    Definition = GetParameterDefinitionType(widget, parameter),
                                    Value = (parameter.Value == null) ?
                                        WidgetDefinitionRepository.Find(widget.WidgetDefinitionId).ParameterDefinitions.Single(x => x.Id == parameter.ParameterDefinitionId).DefaultValue
                                        :
                                        parameter.Value
                                }).ToList()
                            }
                        ).ToList()
                    }).ToList()
                },
                Announcements = announcementResponseModel,
                PollingIntervalInSeconds = Int32.Parse(CloudConfigurationManager.GetSetting("SignboardPollingIntervalInSeconds")),
                Requests = signboardRequests,
                IsShowingScreensaver = isShowingScreensaver,
                FontFactor = fontFactor
            };

            if (returnVal == null)
            {
                return null;
            }

            if (returnVal.Slideshow != null)
            {
                // add default values if there are no values supplied
                foreach (SlideResponseModel slide in returnVal.Slideshow.Slides)
                {
                    foreach (WidgetResponseModel widget in slide.Widgets)
                    {
                        WidgetDefinition widgetDefinition = WidgetDefinitionRepository.FindByName(widget.Type);

                        foreach (ParameterDefinition parameterDefinition in widgetDefinition.ParameterDefinitions)
                        {
                            if (!widget.Parameters.Select(x => x.Definition).Contains(parameterDefinition.Name))
                            {
                                widget.Parameters.Add(new ParameterResponseModel()
                                {
                                    Definition = parameterDefinition.Name,
                                    Value = parameterDefinition.DefaultValue
                                });
                            }
                        }
                    }
                }
            }

            return returnVal;
        }
Beispiel #38
0
		partial void OnSetSlideshow(ref Slideshow value);
Beispiel #39
0
		partial void OnGetSlideShow(ref Slideshow value);
        private bool IsNewSlideshowToDisplay(Slideshow newSlideshow)
        {
            if (newSlideshow == null || newSlideshow.Slides == null || newSlideshow.Slides.Count == 0)
            {
                return false;
            }

            if (CurrentSlideshow == null)
            {
                return true;
            }

            return !CurrentSlideshow.Equals(newSlideshow);
        }