private void fireRendererChanged()
 {
     if (RendererChanged != null)
     {
         RendererChanged.Invoke(this, null);
     }
 }
Example #2
0
        /// <summary>
        /// Event invoker for the <see cref="RendererChanged"/> event.
        /// </summary>
        /// <param name="e">The event's arguments</param>
        protected virtual void OnRendererChanged(EventArgs e)
        {
            Logger.Info(fmh => fmh("Renderer changed: {0}", _businessObjectRenderer != null ? _businessObjectRenderer.GetType().Name : "null"));

            RendererChanged?.Invoke(this, e);
        }
Example #3
0
 private void OnRendererChanged(EventArgs e)
 {
     RendererChanged?.Invoke(this, e);
 }
Example #4
0
 private static void OnRendererChanged()
 {
     RendererChanged?.Invoke(null, EventArgs.Empty);
 }
        public void Update(DiscreteInput input)
        {
            switch (input)
            {
            case DiscreteInput.ToggleFollowMode:
                FollowMode = !FollowMode;
                _message.ShowMessage($"Follow mode is {(FollowMode ? "ON" : "OFF")}");
                FollowModeChanged?.Invoke(this, EventArgs.Empty);
                break;

            case DiscreteInput.ToggleRotateMode:
                RotateMode = !RotateMode;
                _message.ShowMessage($"Rotate mode is {(RotateMode ? "ON" : "OFF")}");
                RotateModeChanged?.Invoke(this, EventArgs.Empty);
                break;

            case DiscreteInput.ToggleLineAntiAliasing:
                DrawAntiAliased = !DrawAntiAliased;
                _message.ShowMessage($"Draw antialiased lines is {(DrawAntiAliased ? "ON" : "OFF")}");
                DrawAntiAliasedModeChanged?.Invoke(this, EventArgs.Empty);
                break;

            case DiscreteInput.ToggleShowRenderTime:
                ShowRenderTime = !ShowRenderTime;
                ShowRenderTimeChanged?.Invoke(this, EventArgs.Empty);
                break;

            case DiscreteInput.SwitchRenderer:
                Renderer = Renderer.Next();
                RendererChanged?.Invoke(this, EventArgs.Empty);
                break;

            case DiscreteInput.ToggleOverheadMap:
                if (Renderer == RendererType.FirstPerson)
                {
                    Renderer = RendererType.Overhead;
                    RendererChanged?.Invoke(this, EventArgs.Empty);
                }
                else if (Renderer == RendererType.Overhead)
                {
                    Renderer = RendererType.FirstPerson;
                    RendererChanged?.Invoke(this, EventArgs.Empty);
                }
                break;

            case DiscreteInput.DecreaseRenderFidelity:
            {
                var oldScale = RenderScale;
                RenderScale = RenderScale.DecreaseFidelity();
                if (oldScale != RenderScale)
                {
                    RenderScaleChanged?.Invoke(this, EventArgs.Empty);
                }
            }
            break;

            case DiscreteInput.IncreaseRenderFidelity:
            {
                var oldScale = RenderScale;
                RenderScale = RenderScale.IncreaseFidelity();
                if (oldScale != RenderScale)
                {
                    RenderScaleChanged?.Invoke(this, EventArgs.Empty);
                }
            }
            break;

            default:
                break;
            }
        }