Exemplo n.º 1
0
        public IgdbApi(UpdatableAppSettings settings)
        {
            this.settings         = settings;
            requestLimiterHandler = TimeLimiter
                                    .GetFromMaxCountByInterval(4, TimeSpan.FromSeconds(1))
                                    .AsDelegatingHandler();
            HttpClient = new HttpClient(requestLimiterHandler);
            HttpClient.DefaultRequestHeaders.Add("Accept", "application/json");
            CacheRoot = settings.Settings.IGDB.CacheDirectory;
            if (!Path.IsPathRooted(CacheRoot))
            {
                CacheRoot = Path.Combine(Paths.ExecutingDirectory, CacheRoot);
            }

            Games              = new Games(this);
            AlternativeNames   = new AlternativeNames(this);
            InvolvedCompanies  = new InvolvedCompanies(this);
            Genres             = new Genres(this);
            Websites           = new Websites(this);
            GameModes          = new GameModes(this);
            PlayerPerspectives = new PlayerPerspectives(this);
            Covers             = new Covers(this);
            Artworks           = new Artworks(this);
            Screenshots        = new Screenshots(this);
            AgeRatings         = new AgeRatings(this);
            Collections        = new Collections(this);
        }
Exemplo n.º 2
0
        public override async Task Initialize()
        {
            StoreApp = await _appStoreService.GetAppDetailsAsync(StoreApp.Id);

            Screenshots.ReplaceRange(StoreApp.Screenshots);
            AppDetailDescription = StoreApp.Description;
        }
Exemplo n.º 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            wassaved = 1;
            int newname = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;

            screenNametopass = newname.ToString();
            string caseID          = Cnotes.caseIDtopass;
            var    destinationPath = @".\Screenshots\" + caseID;

            Directory.CreateDirectory(destinationPath);
            string destinationFile = Path.Combine(destinationPath, newname.ToString() + ".png");

            screenDesttopass = destinationFile;
            File.Copy(@".\temp.jpeg", destinationFile, true);
            string screenhash = BytesToString(GetHashMd5(Save.screenDesttopass));
            string screenname = Save.screenNametopass;

            using (var db = new LiteDatabase(MainMenu.line))
            {
                var collection = db.GetCollection <Screenshots>("screenshots");
                var screenshot = new Screenshots
                {
                    Hash = screenhash,
                    Name = screenname
                };
                collection.Insert(screenshot);
                var query = collection
                            .Find(Query.EQ("Name", screenname))
                            .Select(x => x.Id).FirstOrDefault();
                Cnotes.screenID = query;
            }

            Close();
        }
Exemplo n.º 4
0
        public void sendEmailToO2Support(string subject, string text, bool sendSync)
        {
            sendMessageToolStripMenuItem1.Text = "Sending email....";
            try
            {
                var screenShotToSend = new PictureBox
                {
                    BackgroundImage =
                        Screenshots.getScreenshotOfFormObjectAndItsControls(this)
                };
                DI.log.debug("Sending email to O2 Support with: " + text);
                Mail.sendMail(PublicDI.sEmailHost, "*****@*****.**",
                              PublicDI.sEmailToSendBugReportsTo, "",
                              "Email from O2 User - " + subject,
                              Mail.getUserDetailsAsEmailFormat() + Environment.NewLine + text,
                              DebugMsg.createAttachmentsForRemoteSupport(DebugMsg.getFirstRtbObject(), screenShotToSend),
                              sendSync, emailMessageSent);

                //
            }
            catch (Exception ex)
            {
                DI.log.ex(ex, "in sendEmailToO2Support");
                DI.log.error(
                    "Could not send support email, please ensure that this o2 module is connected to the Internet");
            }
        }
Exemplo n.º 5
0
        public Steps(WebDriver webDriver)
        {
            _webDriver = webDriver;
            _webDriver.Current.Manage().Window.Maximize();

            _screenshots = new Screenshots(webDriver);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Either Starts the new Timer or Cancles the currently running one
        /// </summary>
        public async void StartStopTimer(bool canceledEarly = false)
        {
            if (StopTimer != null)
            {
                if (Logic.soundIsPlaying)
                {
                    Logic.MediaEnded(null, true);
                }
                StopTimer.Cancel();
                StopTimer = null;
                if (canceledEarly == true)
                {
                    ScreenshotImage   = ScreenCapture.ImageSourceFromBitmap(Properties.Resources.background);
                    ShowVersionNumber = true;
                }

                StartStopButtonText = "Start";
                TimerText           = "00:00:00";
                screenshots         = null;
            }
            else
            {
                ShowVersionNumber   = false;
                StartStopButtonText = "Stop";
                StopTimer           = new CancellationTokenSource();
                screenshots         = new Screenshots(Config.saveLastXScreenshots);
                await TimerTick(StopTimer.Token);
            }
        }
Exemplo n.º 7
0
        private IEnumerator _Screenshot()
        {
            foreach (var o in Hide)
            {
                o.SetActive(false);
            }
            foreach (var o in Show)
            {
                o.SetActive(true);
            }

            yield return(new WaitForEndOfFrame());

            yield return(StartCoroutine(Screenshots.ShareScreenshotSimple()));

            Flash?.SetActive(false);
            Flash?.SetActive(true);
            yield return(null);

            foreach (var o in Hide)
            {
                o.SetActive(true);
            }
            foreach (var o in Show)
            {
                o.SetActive(false);
            }
        }
Exemplo n.º 8
0
        public ActionResult DeleteConfirmed(int id)
        {
            Screenshots screenshots = db.Screenshots.Find(id);

            db.Screenshots.Remove(screenshots);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 9
0
        private bool SaveThreadRoutine(string filename)
        {
#if !DEBUG
            try
            {
#endif
            System.Threading.Thread.CurrentThread.Name = "Save";
            // Ensure we're using the invariant culture.
            System.Threading.Thread.CurrentThread.CurrentCulture   = CultureInfo.InvariantCulture;
            System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
            DirectoryInfo worldDirectory =
                Directory.CreateDirectory(DwarfGame.GetWorldDirectory() +
                                          Path.DirectorySeparatorChar + Overworld.Name);

            // This is a hack. Why does the overworld have this as a static field??
            Overworld.NativeFactions = this.Natives;
            NewOverworldFile file = new NewOverworldFile(Game.GraphicsDevice, Overworld.Map, Overworld.Name, SeaLevel);
            file.WriteFile(worldDirectory.FullName);

            try
            {
                file.SaveScreenshot(worldDirectory.FullName + Path.DirectorySeparatorChar + "screenshot.png");
            }
            catch (Exception exception)
            {
                Console.Error.WriteLine(exception.ToString());
            }

            gameFile = SaveGame.CreateFromWorld(this);
            var path = DwarfGame.GetSaveDirectory() + Path.DirectorySeparatorChar +
                       filename;
            SaveGame.DeleteOldestSave(path, GameSettings.Default.MaxSaves, "Autosave");
            gameFile.WriteFile(path);
            ComponentManager.CleanupSaveData();

            lock (ScreenshotLock)
            {
                Screenshots.Add(new Screenshot()
                {
                    FileName = DwarfGame.GetSaveDirectory() +
                               Path.DirectorySeparatorChar + filename + Path.DirectorySeparatorChar +
                               "screenshot.png",
                    Resolution = new Point(128, 128)
                });
            }
#if !DEBUG
        }

        catch (Exception exception)
        {
            Console.Error.Write(exception.ToString());
            Game.CaptureException(exception);
            throw new WaitStateException(exception.Message);
        }
#endif
            return(true);
        }
Exemplo n.º 10
0
 private void Screenshots_SizeChanged(object sender, EventArgs e)
 {
     Screenshots.SuspendLayout();
     foreach (Control ctrl in Screenshots.Controls)
     {
         ctrl.Size = GetScreenShotSize(ctrl as PictureBox, Screenshots);
     }
     Screenshots.ResumeLayout();
 }
Exemplo n.º 11
0
 public ActionResult Edit([Bind(Include = "Id,Background,Head,Text")] Screenshots screenshots)
 {
     if (ModelState.IsValid)
     {
         db.Entry(screenshots).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(screenshots));
 }
        public Image takeScreenShot()
        {
            var image = Screenshots.getScreenshotOfDesktop();

            //var image = Screenshots.getScreenshotOfFormObjectAndItsControls(this);
            "image:{0}".info(image.typeName());

            pictureBox.BackgroundImage = image;
            return(image);
        }
Exemplo n.º 13
0
        public override void TakeScreenshot()
        {
            try
            {
                Debug.WriteLine("Creating a MTN process...");
                string assemblyMTN = (Program.IsUNIX ? Program.Settings.MTNPath.Replace(".exe", "") : Program.Settings.MTNPath);
                if (string.IsNullOrEmpty(Path.GetDirectoryName(assemblyMTN)))
                {
                    assemblyMTN = Path.Combine(System.Windows.Forms.Application.StartupPath, assemblyMTN);
                    Program.Settings.MTNPath = assemblyMTN;
                }

                string args = string.Format("{0} \"{1}\"", Adapter.GetMtnArg(ScreenshotDir, Program.mtnProfileMgr.GetMtnProfileActive()), MediaFile.FilePath);

                Process          p   = new Process();
                ProcessStartInfo psi = new ProcessStartInfo(assemblyMTN);

                if (Program.IsUNIX)
                {
                    psi.UseShellExecute = false;
                }

                Debug.WriteLine("MTN Path: " + assemblyMTN);
                Debug.WriteLine("MTN Args: " + args);

                psi.WindowStyle = (Program.Settings.ShowMTNWindow ? ProcessWindowStyle.Normal : ProcessWindowStyle.Minimized);
                Debug.WriteLine("MTN Window: " + psi.WindowStyle.ToString());
                psi.Arguments = args;

                p.StartInfo = psi;
                p.Start();
                p.WaitForExit(1000 * 30);

                string ssPath = Path.Combine(ScreenshotDir, Path.GetFileNameWithoutExtension(MediaFile.FilePath) + Program.mtnProfileMgr.GetMtnProfileActive().o_OutputSuffix);
                Screenshots.Add(new Screenshot(ssPath)
                {
                    Args = args
                });

                if (Program.IsUNIX)
                {
                    string info = Path.Combine(FileSystem.GetScreenShotsDir(MediaFile.FilePath), Path.GetFileNameWithoutExtension(MediaFile.FilePath) + Program.mtnProfileMgr.GetMtnProfileActive().N_InfoSuffix);

                    using (StreamReader sr = new StreamReader(info))
                    {
                        MediaSummary = sr.ReadToEnd();
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.ToString());
            }
        }
Exemplo n.º 14
0
        public ActionResult Create([Bind(Include = "Id,Background,Head,Text")] Screenshots screenshots)
        {
            if (ModelState.IsValid)
            {
                db.Screenshots.Add(screenshots);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(screenshots));
        }
Exemplo n.º 15
0
        public void Save(Screenshots screenShot)
        {
            if (screenShot.ScreenshotId <= 0)
            {
                Insert(screenShot);
            }
            else
            {
                Update(screenShot);
            }

            Context.SaveChanges();
        }
Exemplo n.º 16
0
        // GET: manage/Screenshots/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Screenshots screenshots = db.Screenshots.Find(id);

            if (screenshots == null)
            {
                return(HttpNotFound());
            }
            return(View(screenshots));
        }
        private void Startup()
        {
            if (NativeHelpers.Services_GetSteamLoadStatus() == LoadStatus.NotLoaded)
            {
                // Only startup the native parts if they are not loaded yet
                if (!NativeMethods.Services_Startup(Constants.VersionInfo.InterfaceID))
                {
                    // Setup failed!
                    Instance = null;
                    ErrorCodes error = NativeHelpers.Services_GetErrorCode();
                    if (error == ErrorCodes.InvalidInterfaceVersion)
                    {
                        Error.ThrowError(ErrorCodes.InvalidInterfaceVersion,
                                         NativeMethods.Services_GetInterfaceVersion(), Constants.VersionInfo.InterfaceID);
                    }
                    else
                    {
                        Error.ThrowError(error);
                    }
                }
            }

            AppID = new SteamTypes.AppID(NativeMethods.Services_GetAppID());

            serviceJobs = new JobManager();
            serviceJobs.AddJob(new DelegateJob(() => RegisterManagedCallback(), () => RemoveManagedCallback()));
            serviceJobs.AddJob(new DelegateJob(() => cloud              = new Cloud(), () => cloud.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => stats              = new Stats(), () => stats.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => user               = new User(), () => user.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => friends            = new Friends(), () => friends.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => matchmaking        = new MatchMaking(), () => matchmaking.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => matchmakingServers = new MatchmakingServers(), () => matchmakingServers.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => networking         = new Networking(), () => networking.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => utils              = new Utils(), () => utils.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => apps               = new Apps(), () => apps.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => http               = new HTTP(), () => http.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => screenshots        = new Screenshots(), () => screenshots.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => ugc             = new UGC(), () => ugc.ReleaseManagedResources()));
            serviceJobs.AddJob(new DelegateJob(() => steamcontroller = new SteamController(), () => steamcontroller.ReleaseManagedResources()));

            hmd = new Hmd();

            serviceJobs.RunCreateJobs();
        }
        private void Closing()
        {
            var screenshot = Screenshots?.FirstOrDefault(s => s.IsSelected);

            if (screenshot != null)
            {
                _log.Debug($"Attempting to save screenshot #{screenshot.Index}");
                try
                {
                    _cap.SaveImage(screenshot);
                }
                catch (Exception e)
                {
                    _log.Error(e.Message);
                }
            }
            else
            {
                _log.Debug($"No screenshot selected (len={Screenshots?.Count})");
            }
        }
Exemplo n.º 19
0
        public void Test_Case_1_Automate_Registration(string browserName)
        {
            try
            {
                Setup(browserName);
                var homePage     = new HomePageObjects(driver);
                var loginPage    = new loginPage(driver);
                var registration = new AccountCreationPage(driver);

                homePage.clickTheSignInBtn();
                loginPage.clickEmailAddressFieldAndEnterEmailAddress();
                loginPage.clickCreateAnAccountButton();
                registration.completePersonalInformation();
                registration.completeAddressDetails();
                registration.clickTheRegisterButton();
                registration.checkThatTheUserIsRegistered();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                var    screenshot = new Screenshots(driver);
                string fileName   = MethodBase.GetCurrentMethod().Name;
            }
        }
Exemplo n.º 20
0
 public void TearDown()
 {
     //Take a screenshot if a test failed. Ideally this will capture the state of the application at the moment of failure.
     try
     {
         if (TestContext.CurrentContext.Result.Status.ToString().ToLower().Equals("failed"))
         {
             Screenshots.takeScreenShot(TestContext.CurrentContext, getDriver());
         }
     }
     //Catch any system exception and output the stacktrace
     catch (SystemException se)
     {
         Console.WriteLine(se.StackTrace);
     }
     //Even if an exception occurs, dispose of the driver and all associated browsers
     finally
     {
         if (getDriver() != null)
         {
             getDriver().Dispose();
         }
     }
 }
Exemplo n.º 21
0
        private void btOpenDir_Click(object sender, EventArgs e)
        {
            string userDir = Screenshots.GetDirectoryName(editedUser);

            Process.Start("explorer.exe", userDir);
        }
        internal void I_Get_Screenshot_when_test_failed(TestContext testContext)
        {
            Screenshots ss = new Screenshots(driver);

            ss.TakeScreenshotIfFails(testContext);
        }
Exemplo n.º 23
0
        private void RunNewThread()
        {
            Screenshots rd = new Screenshots();

            rd.Start();
        }
Exemplo n.º 24
0
 public void CaptureScreenshot()
 {
     Screenshots.Capture(
         TestContext.CurrentContext.Test.FullName.Replace("\"", string.Empty).Substring(22),
         TestContexts.ArtifactsPath);
 }
Exemplo n.º 25
0
        /// <summary>
        /// Called when a frame is to be drawn to the screen
        /// </summary>
        /// <param name="gameTime">The current time</param>
        public void Render(DwarfTime gameTime)
        {
            if (!ShowingWorld)
            {
                return;
            }
            ValidateShader();
            var frustum     = Camera.GetDrawFrustum();
            var renderables = EnumerateIntersectingObjects(frustum,
                                                           r => r.IsVisible && !ChunkManager.IsAboveCullPlane(r.GetBoundingBox()));

            // Controls the sky fog
            float x = (1.0f - Sky.TimeOfDay);

            x = x * x;
            DefaultShader.FogColor       = new Color(0.32f * x, 0.58f * x, 0.9f * x);
            DefaultShader.LightPositions = LightPositions;

            CompositeLibrary.Render(GraphicsDevice);
            CompositeLibrary.Update();

            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;

            // Computes the water height.
            float wHeight = WaterRenderer.GetVisibleWaterHeight(ChunkManager, Camera, GraphicsDevice.Viewport,
                                                                lastWaterHeight);

            lastWaterHeight = wHeight;

            // Draw reflection/refraction images
            WaterRenderer.DrawReflectionMap(renderables, gameTime, this, wHeight - 0.1f,
                                            GetReflectedCameraMatrix(wHeight),
                                            DefaultShader, GraphicsDevice);


            #region Draw Selection Buffer.

            if (SelectionBuffer == null)
            {
                SelectionBuffer = new SelectionBuffer(8, GraphicsDevice);
            }

            GraphicsDevice.RasterizerState   = RasterizerState.CullNone;
            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;

            Plane slicePlane = WaterRenderer.CreatePlane(SlicePlane, new Vector3(0, -1, 0), Camera.ViewMatrix, false);

            if (SelectionBuffer.Begin(GraphicsDevice))
            {
                // Draw the whole world, and make sure to handle slicing
                DefaultShader.ClipPlane       = new Vector4(slicePlane.Normal, slicePlane.D);
                DefaultShader.ClippingEnabled = true;
                DefaultShader.View            = Camera.ViewMatrix;
                DefaultShader.Projection      = Camera.ProjectionMatrix;
                DefaultShader.World           = Matrix.Identity;

                //GamePerformance.Instance.StartTrackPerformance("Render - Selection Buffer - Chunks");
                ChunkRenderer.RenderSelectionBuffer(DefaultShader, GraphicsDevice, Camera.ViewMatrix);
                //GamePerformance.Instance.StopTrackPerformance("Render - Selection Buffer - Chunks");

                //GamePerformance.Instance.StartTrackPerformance("Render - Selection Buffer - Components");
                ComponentRenderer.RenderSelectionBuffer(renderables, gameTime, ChunkManager, Camera,
                                                        DwarfGame.SpriteBatch, GraphicsDevice, DefaultShader);
                //GamePerformance.Instance.StopTrackPerformance("Render - Selection Buffer - Components");

                //GamePerformance.Instance.StartTrackPerformance("Render - Selection Buffer - Instances");
                InstanceRenderer.Flush(GraphicsDevice, DefaultShader, Camera,
                                       InstanceRenderMode.SelectionBuffer);
                //GamePerformance.Instance.StopTrackPerformance("Render - Selection Buffer - Instances");

                SelectionBuffer.End(GraphicsDevice);
            }


            #endregion



            // Start drawing the bloom effect
            if (GameSettings.Default.EnableGlow)
            {
                bloom.BeginDraw();
            }

            // Draw the sky
            GraphicsDevice.Clear(DefaultShader.FogColor);
            DrawSky(gameTime, Camera.ViewMatrix, 1.0f, DefaultShader.FogColor);

            // Defines the current slice for the GPU
            float level = ChunkManager.World.Master.MaxViewingLevel + 0.25f;
            if (level > VoxelConstants.ChunkSizeY)
            {
                level = 1000;
            }

            SlicePlane = level;
            CaveView   = CaveView * 0.9f + TargetCaveView * 0.1f;
            DefaultShader.WindDirection = Weather.CurrentWind;
            DefaultShader.WindForce     = 0.0005f * (1.0f + (float)Math.Sin(Time.GetTotalSeconds() * 0.001f));
            // Draw the whole world, and make sure to handle slicing
            DefaultShader.ClipPlane       = new Vector4(slicePlane.Normal, slicePlane.D);
            DefaultShader.ClippingEnabled = true;
            //Blue ghost effect above the current slice.
            DefaultShader.GhostClippingEnabled = true;
            Draw3DThings(gameTime, DefaultShader, Camera.ViewMatrix);

            // Now we want to draw the water on top of everything else
            DefaultShader.ClippingEnabled      = true;
            DefaultShader.GhostClippingEnabled = false;

            //ComponentManager.CollisionManager.DebugDraw();

            DefaultShader.View                 = Camera.ViewMatrix;
            DefaultShader.Projection           = Camera.ProjectionMatrix;
            DefaultShader.GhostClippingEnabled = true;
            // Now draw all of the entities in the game
            DefaultShader.ClipPlane       = new Vector4(slicePlane.Normal, slicePlane.D);
            DefaultShader.ClippingEnabled = true;

            if (Debugger.Switches.DrawOcttree)
            {
                foreach (var box in OctTree.EnumerateBounds(frustum))
                {
                    Drawer3D.DrawBox(box.Item2, Color.Yellow, 1.0f / (float)(box.Item1 + 1), false);
                }
            }

            // Render simple geometry (boxes, etc.)
            Drawer3D.Render(GraphicsDevice, DefaultShader, Camera, DesignationDrawer, PlayerFaction.Designations, this);

            DefaultShader.EnableShadows = false;

            DefaultShader.View = Camera.ViewMatrix;

            ComponentRenderer.Render(renderables, gameTime, ChunkManager,
                                     Camera,
                                     DwarfGame.SpriteBatch, GraphicsDevice, DefaultShader,
                                     ComponentRenderer.WaterRenderType.None, lastWaterHeight);
            InstanceRenderer.Flush(GraphicsDevice, DefaultShader, Camera, InstanceRenderMode.Normal);

            if (Master.CurrentToolMode == GameMaster.ToolMode.BuildZone ||
                Master.CurrentToolMode == GameMaster.ToolMode.BuildWall ||
                Master.CurrentToolMode == GameMaster.ToolMode.BuildObject)
            {
                DefaultShader.View       = Camera.ViewMatrix;
                DefaultShader.Projection = Camera.ProjectionMatrix;
                DefaultShader.SetTexturedTechnique();
                GraphicsDevice.BlendState = BlendState.NonPremultiplied;
            }

            WaterRenderer.DrawWater(
                GraphicsDevice,
                (float)gameTime.TotalGameTime.TotalSeconds,
                DefaultShader,
                Camera.ViewMatrix,
                GetReflectedCameraMatrix(wHeight),
                Camera.ProjectionMatrix,
                new Vector3(0.1f, 0.0f, 0.1f),
                Camera,
                ChunkManager);
            ParticleManager.Render(this, GraphicsDevice);
            DefaultShader.ClippingEnabled = false;

            if (GameSettings.Default.EnableGlow)
            {
                bloom.DrawTarget = UseFXAA ? fxaa.RenderTarget : null;

                if (UseFXAA)
                {
                    fxaa.Begin(DwarfTime.LastTime);
                }
                bloom.Draw(gameTime.ToRealTime());
                if (UseFXAA)
                {
                    fxaa.End(DwarfTime.LastTime);
                }
            }
            else if (UseFXAA)
            {
                fxaa.End(DwarfTime.LastTime);
            }

            RasterizerState rasterizerState = new RasterizerState()
            {
                ScissorTestEnable = true
            };


            if (Debugger.Switches.DrawSelectionBuffer)
            {
                SelectionBuffer.DebugDraw(GraphicsDevice.Viewport.Bounds);
            }

            try
            {
                DwarfGame.SafeSpriteBatchBegin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, Drawer2D.PointMagLinearMin,
                                               null, rasterizerState, null, Matrix.Identity);
                //DwarfGame.SpriteBatch.Draw(Shadows.ShadowTexture, Vector2.Zero, Color.White);
                if (IsCameraUnderwater())
                {
                    Drawer2D.FillRect(DwarfGame.SpriteBatch, GraphicsDevice.Viewport.Bounds, new Color(10, 40, 60, 200));
                }

                Drawer2D.Render(DwarfGame.SpriteBatch, Camera, GraphicsDevice.Viewport);

                IndicatorManager.Render(gameTime);
            }
            finally
            {
                DwarfGame.SpriteBatch.End();
            }

            if (Debugger.Switches.DrawComposites)
            {
                Vector2 offset = Vector2.Zero;
                foreach (var composite in CompositeLibrary.Composites)
                {
                    offset = composite.Value.DebugDraw(DwarfGame.SpriteBatch, (int)offset.X, (int)offset.Y);
                }
            }


            Master.Render(Game, gameTime);

            DwarfGame.SpriteBatch.GraphicsDevice.ScissorRectangle =
                DwarfGame.SpriteBatch.GraphicsDevice.Viewport.Bounds;


            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;

            lock (ScreenshotLock)
            {
                foreach (Screenshot shot in Screenshots)
                {
                    TakeScreenshot(shot.FileName, shot.Resolution);
                }

                Screenshots.Clear();
            }
        }
Exemplo n.º 26
0
        public GameViewModel(Game game) : this()
        {
            GameID           = game.GameID;
            GameName         = game.GameName;
            URL              = game.URL;
            CoverImageURL    = game.CoverImageURL;
            StoryLine        = game.StoreLine;
            Summary          = game.Summary;
            FirstReleaseDate = game.FirstReleaseDate;
            Published        = game.Published.HasValue ? game.Published.Value : false;

            foreach (var gameGenre in game.GameGenres)
            {
                Genres.Add(
                    new GenreViewModel(gameGenre.Genre)
                    );
            }

            foreach (var gameTheme in game.GameThemes)
            {
                Themes.Add(
                    new ThemeViewModel(gameTheme.Theme)
                    );
            }

            foreach (var gameMode in game.GameModes)
            {
                Modes.Add(
                    new ModeViewModel(gameMode.Mode)
                    );
            }

            foreach (var gamePerspective in game.GamePerspectives)
            {
                Perspectives.Add(
                    new PerspectiveViewModel(gamePerspective.Perspective)
                    );
            }

            foreach (var gameScreenshots in game.GameScreenshots)
            {
                Screenshots.Add(
                    new ScreenshotViewModel(gameScreenshots.Screenshot)
                    );
            }

            foreach (var gamePlatform in game.GamePlatforms)
            {
                Platforms.Add(
                    new PlatformViewModel(
                        gamePlatform.Platform,
                        gamePlatform.ReleaseDate.Value)
                    );

                foreach (var history in gamePlatform.VendorGameHistories)
                {
                    PriceHistory.Add(
                        new PriceHistoryViewModel(history)
                        );
                }
            }


            if (PriceHistory.Count() > 0)
            {
                TodaysPrices  = PriceHistory?.Where(ph => ph.CreatedDate >= DateTime.Today).ToList();
                Cheapest      = TodaysPrices?.GroupBy(ph => ph.Price)?.OrderBy(ph => double.Parse(ph.Key))?.FirstOrDefault()?.Select(ph => ph).ToList();
                CheapestPrice = Cheapest?.FirstOrDefault().Price;
            }

            foreach (var settings in game.GamePlatforms.Select(gp => gp.VendorGameSettings))
            {
                foreach (var setting in settings)
                {
                    Settings.Add(new VendorGameSettingViewModel(setting));
                }
            }
        }
Exemplo n.º 27
0
 public void Delete(Screenshots screenShot)
 {
     entities.Remove(screenShot);
     Context.SaveChanges();
 }
Exemplo n.º 28
0
 public void Update(Screenshots screenShot)
 {
     Context.Entry(screenShot).State = EntityState.Modified;
 }
Exemplo n.º 29
0
 public void Insert(Screenshots screenShot)
 {
     entities.Add(screenShot);
 }
Exemplo n.º 30
0
        /*private void btPingMailServer_Click(object sender, EventArgs e)
         * {
         *  bOnPingSuccessHideControls = false;
         *  btPingMailServer.Enabled = false;
         *  lbPingStatus.Text = "";
         *  Ping.ping_Async(tbMailServer.Text);
         * }*/

        public void updateImageWithScreenShotOfParentForm()
        {
            setScreenShoot(Screenshots.getScreenshotOfFormObjectAndItsControls(fParentForm));
            //setScreenShoot(Screenshots.getScreenshotOfFormObjectAndItsControls(btRefresh_LogViewerData));
        }