private void NextImage()
        {
            // write stat every day at 8PM
            if (_settings._writeStat && _prevTime == 20 && DateTime.Now.Hour == _prevTime + 1)
            {
                _images.WriteStat(_settings._writeStatPath);
            }

            _prevTime = DateTime.Now.Hour;

            ImageInfo nextphoto = _images.GetNext();

            if (nextphoto != null)
            {
                try
                {
                    PhotoProperties.PhotoDescription = nextphoto.description;
                    var ft = TimeSpan.FromMilliseconds(_settings._noImageFading ||
                                                       (_isNightTime && _settings._noNightImageFading)
                                            ? 0 : _settings._fadeSpeed);

                    var mt = TimeSpan.MinValue;

                    if (!(_settings._noImageScaling || (_isNightTime && _settings._noNightImageScaling)))
                    {
                        mt = TimeSpan.FromSeconds(_settings._updateInterval);
                    }

                    bool acc = !_settings._noImageAccents && !(_isNightTime && _settings._noNightImageAccents);

                    if (!FirstImage.IsActive)
                    {
                        FirstImage.Activate(nextphoto, ft, mt, acc);
                        SecondImage.Deactivate(ft);
                    }
                    else
                    {
                        SecondImage.Activate(nextphoto, ft, mt, acc);
                        FirstImage.Deactivate(ft);
                    }

                    PhotoProperties.SetFacesFound(nextphoto.accent_count);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("ERROR: " + ex.Message);
                }
            }
        }
        private void LoadData()
        {
            eclipse.SetBackgroundResource(Resource.Drawable.eclipse_cover);

            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_happy, ImageDescription = "Happy"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_peacefull, ImageDescription = "Peaceful"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_content, ImageDescription = "Content"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_okay, ImageDescription = "Okay"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_sad, ImageDescription = "Sad"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_bored, ImageDescription = "Bored"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_worried, ImageDescription = "Worried"
            });
            FirstImage.Add(new ImageData()
            {
                ImageResource = Resource.Drawable.emoji_angry, ImageDescription = "Angry"
            });
            WheelImageAdapter imageAdapter = new WheelImageAdapter(this.Context, FirstImage);

            wheel_image.SetAdapter(imageAdapter);

            //Number Wheel Start
            //FirstText = new List<MenuItemData>();
            //for (int i = 0; i < 9; i++)
            //    FirstText.Add(new MenuItemData() { mTitle = Convert.ToString(i) });
            //FirstText.Add(new MenuItemData() { mTitle = "OFF" });
            //WheelTextAdapter textAdapter = new WheelTextAdapter(BaseContext, FirstText);
            //wheel_text.SetAdapter(textAdapter);
            //Number Wheel End
        }
        public void ChooseShoesCategory()
        {
            Actions     actions = new Actions(_driver);
            IWebElement target  = ShopMenButton;

            actions.MoveToElement(target).Perform();
            Thread.Sleep(3000);
            ShoesButton.Click();
            Thread.Sleep(4000);
            FirstImage.Click();
            Thread.Sleep(3000);
            ShoeSizeButton.Click();
            Thread.Sleep(2000);
            AddToBagButton.Click();
            Thread.Sleep(3000);
        }
Example #4
0
        void ReleaseDesignerOutlets()
        {
            if (FirstImage != null)
            {
                FirstImage.Dispose();
                FirstImage = null;
            }

            if (SecondImage != null)
            {
                SecondImage.Dispose();
                SecondImage = null;
            }

            if (TestCaptureButton != null)
            {
                TestCaptureButton.Dispose();
                TestCaptureButton = null;
            }

            if (TrackingMessage != null)
            {
                TrackingMessage.Dispose();
                TrackingMessage = null;
            }

            if (FirstActivityIndicator != null)
            {
                FirstActivityIndicator.Dispose();
                FirstActivityIndicator = null;
            }

            if (SecondActivityIndicator != null)
            {
                SecondActivityIndicator.Dispose();
                SecondActivityIndicator = null;
            }
        }
 public void CalulateImageNumbers(object sender, EventArgs args)
 {
     if (Every > 0 && LastImage >= FirstImage)
     {
         ImageNumbers  = (LastImage - FirstImage) / Every + 1;
         LoadingImages = "";
         if (ImageNumbers >= 1)
         {
             LoadingImages = FirstImage.ToString();
             if (ImageNumbers >= 2)
             {
                 var num2 = FirstImage + Every;
                 LoadingImages += "、" + num2.ToString();
                 if (ImageNumbers >= 3)
                 {
                     var num3 = FirstImage + 2 * Every;
                     LoadingImages += "、" + num3.ToString();
                     if (ImageNumbers == 4)
                     {
                         var num4 = FirstImage + 3 * Every;
                         LoadingImages += "、" + num4.ToString();
                     }
                     if (ImageNumbers > 4)
                     {
                         var num4 = FirstImage + (ImageNumbers - 1) * Every;
                         LoadingImages += "、...、" + num4.ToString();
                     }
                 }
             }
         }
     }
     else
     {
         ImageNumbers  = 0;
         LoadingImages = "0";
     }
 }
Example #6
0
        private async void ApplyExecute()
        {
            if (FirstImage == null || SecondImage == null)
            {
                return;
            }

            if (_inProgress)
            {
                _queuedApply = true;
                return;
            }

            FilterApplied = false;
            _inProgress   = true;

            using (var firstStream = FirstImage.ToStream())
                using (var secondStream = SecondImage.ToStream())
                    using (var session = await EditingSessionFactory.CreateEditingSessionAsync(firstStream))
                        using (var blendingSession = await EditingSessionFactory.CreateEditingSessionAsync(secondStream))
                        {
                            session.AddFilter(FilterFactory.CreateBlendFilter(blendingSession, SelectedBlendFunction));
                            var wb = new WriteableBitmap(FirstImage.PixelWidth, FirstImage.PixelHeight);
                            await session.RenderToWriteableBitmapAsync(wb);

                            BlendedImage = wb;
                        }

            _inProgress   = false;
            FilterApplied = true;
            if (_queuedApply)
            {
                _queuedApply = false;
                ApplyExecute();
            }
        }
Example #7
0
 public bool MatchPair(Pair pair)
 {
     return(FirstImage.Equals(pair.FirstImage) && SecondImage.Equals(pair.SecondImage));
 }
Example #8
0
        /// <summary>
        /// Update the toolbar button
        /// </summary>
        private void UpdateToolBarButton()
        {
            if (_report != null)
            {
                TBBRefresh.EnableButton();
                TBBPrint.EnableButton();
                ExportDefault.EnableButton();
                ExportMenu.IsEnabled = true;
                ExportMenu.Opacity   = 1;
                TBBPrintWithProperties.EnableButton();
                ZoomInfoStackPanel.Visibility = Visibility.Visible;
                ZoomPopupButton.Visibility    = Visibility.Visible;
                ZoomPopupButton.IsEnabled     = true;
                ZoomPopupButton.Opacity       = 1;
            }
            else
            {
                TBBRefresh.DisableButton();
                TBBPrint.DisableButton();
                ExportDefault.DisableButton();
                ExportMenu.IsEnabled = true;
                ExportMenu.Opacity   = 1;
                TBBPrintWithProperties.DisableButton();
                ZoomInfoStackPanel.Visibility = Visibility.Collapsed;
                ZoomPopupButton.Visibility    = Visibility.Collapsed;
                ZoomPopupButton.IsEnabled     = false;
                ZoomPopupButton.Opacity       = 0.5;
            }


            if (_pos == 0)
            {
                PagerSeparator.Visibility = Visibility.Visible;
                PreviousImage.DisableButton();
                FirstImage.DisableButton();
                NextImage.EnableButton();
                LastImage.EnableButton();
            }
            else
            {
                if (_pos + 1 == this._report.PagesCount)
                {
                    NextImage.DisableButton();
                    LastImage.DisableButton();
                    PreviousImage.EnableButton();
                    FirstImage.EnableButton();
                }
                else
                {
                    PreviousImage.EnableButton();
                    NextImage.EnableButton();
                    FirstImage.EnableButton();
                    LastImage.EnableButton();
                }
            }

            if (this._report.PagesCount > 1)
            {
                PagerSeparator.Visibility = Visibility.Visible;
                PreviousImage.Visibility  = Visibility.Visible;
                NextImage.Visibility      = Visibility.Visible;
                FirstImage.Visibility     = Visibility.Visible;
                LastImage.Visibility      = Visibility.Visible;
                PageSpinner.Visibility    = Visibility.Visible;
            }
            else
            {
                PagerSeparator.Visibility = Visibility.Collapsed;
                PreviousImage.Visibility  = Visibility.Collapsed;
                NextImage.Visibility      = Visibility.Collapsed;
                FirstImage.Visibility     = Visibility.Collapsed;
                LastImage.Visibility      = Visibility.Collapsed;
                PageSpinner.Visibility    = Visibility.Collapsed;
            }
        }
Example #9
0
 public void ClickFirstResultFromImages()
 {
     ImagesLink.Click();
     FirstImage.Click();
 }