/// <summary>
        ///     The domain unload event.
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="eventArgs">
        ///     The event args.
        /// </param>
        private static void OnDomainUnload(object sender, EventArgs eventArgs)
        {
            if (Font != null)
            {
                Font.OnLostDevice();
                Font.Dispose();
                Font = null;
            }

            if (FontBold != null)
            {
                FontBold.OnLostDevice();
                FontBold.Dispose();
                FontBold = null;
            }

            if (FontBoldItalic != null)
            {
                FontBoldItalic.OnLostDevice();
                FontBoldItalic.Dispose();
                FontBoldItalic = null;
            }

            if (FontItalic != null)
            {
                FontItalic.OnLostDevice();
                FontItalic.Dispose();
                FontItalic = null;
            }
        }
 /// <summary>
 /// Fired when the AppDomain is unloaded.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="eventArgs">The <see cref="EventArgs"/> instance containing the event data.</param>
 private static void CurrentDomainOnDomainUnload(object sender, EventArgs eventArgs)
 {
     BoxLine.OnLostDevice();
     Text.OnLostDevice();
     sprite.OnLostDevice();
     sprite.Dispose();
     Text.Dispose();
     BoxLine.Dispose();
 }
Exemple #3
0
        private void Drawing_OnPreReset(EventArgs args)
        {
            if (Font == null || Font.IsDisposed)
            {
                return;
            }

            Dispose();
            Font?.OnLostDevice();
        }
Exemple #4
0
        /// <summary>
        ///     The domain unload event.
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="eventArgs">
        ///     The event args.
        /// </param>
        private static void OnDomainUnload(object sender, EventArgs eventArgs)
        {
            if (Line != null)
            {
                Line.OnLostDevice();
                Line.Dispose();
                Line = null;
            }

            if (Font != null)
            {
                Font.OnLostDevice();
                Font.Dispose();
                Font = null;
            }

            /*
             * if (FontBold != null)
             * {
             *  FontBold.OnLostDevice();
             *  FontBold.Dispose();
             *  FontBold = null;
             * }
             *
             * if (FontBoldItalic != null)
             * {
             *  FontBoldItalic.OnLostDevice();
             *  FontBoldItalic.Dispose();
             *  FontBoldItalic = null;
             * }
             *
             * if (FontItalic != null)
             * {
             *  FontItalic.OnLostDevice();
             *  FontItalic.Dispose();
             *  FontItalic = null;
             * }
             */
        }
Exemple #5
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            Font = new Font(
                Drawing.Direct3DDevice,
                new FontDescription
            {
                FaceName        = "Tahoma", Height = this.Menu.Item("FontSize").GetValue <Slider>().Value,
                OutputPrecision = FontPrecision.Default, Quality = FontQuality.Antialiased
            });

            Drawing.OnEndScene  += this.Drawing_OnEndScene;
            Drawing.OnPreReset  += args => { Font.OnLostDevice(); };
            Drawing.OnPostReset += args => { Font.OnResetDevice(); };
        }
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            Font = new Font(
                Drawing.Direct3DDevice,
                new FontDescription
                {
                    FaceName = "Tahoma",
                    Height = 30,
                    OutputPrecision = FontPrecision.Default,
                    Quality = FontQuality.Default
                });

            GameObject.OnCreate += this.OnGameObjectCreate;
            GameObject.OnDelete += this.OnGameObjectDelete;
            Drawing.OnEndScene += this.OnDrawingEndScene;

            Drawing.OnPreReset += args => { Font.OnLostDevice(); };
            Drawing.OnPostReset += args => { Font.OnResetDevice(); };
        }
Exemple #7
0
 static void Drawing_OnPreReset(EventArgs args)
 {
     S.OnLostDevice();
     RecF.OnLostDevice();
 }
Exemple #8
0
 void Drawing_OnPreReset(EventArgs args)
 {
     Text.OnLostDevice();
 }
Exemple #9
0
        /// <summary>
        ///     Loads this instance.
        /// </summary>
        public void Load()
        {
            Font = new Font(
                Drawing.Direct3DDevice,
                new FontDescription
                {
                    FaceName = "Tahoma",
                    Height = getSliderItem("FontSize"),
                    OutputPrecision = FontPrecision.Default,
                    Quality = FontQuality.Default
                });

            Drawing.OnEndScene += this.Drawing_OnEndScene;
            Drawing.OnPreReset += args => { Font.OnLostDevice(); };
            Drawing.OnPostReset += args => { Font.OnResetDevice(); };
        }
Exemple #10
0
 private static void DrawingOnOnPreReset(EventArgs args)
 {
     Text.OnLostDevice();
     TextLittle.OnLostDevice();
 }
Exemple #11
0
 private void Drawing_OnPreReset(EventArgs args)
 {
     Dispose();
     Font?.OnLostDevice();
 }
Exemple #12
0
 /// <summary>
 /// Fired before the DirectX device has been reset.
 /// </summary>
 /// <param name="args">The <see cref="EventArgs"/> instance containing the event data.</param>
 private static void DrawingOnPreReset(EventArgs args)
 {
     Text.OnLostDevice();
     BoxLine.OnLostDevice();
 }
Exemple #13
0
 private static void Drawing_OnPreReset(EventArgs args)
 {
     text.OnLostDevice();
 }
Exemple #14
0
 private static void DrawingOnOnPreReset(EventArgs args)
 {
     TextStatus.OnLostDevice();
 }
Exemple #15
0
 private static void DrawingOnPreReset(EventArgs args)
 {
     //Game.PrintChat("DrawingOnPreReset");
     Text.OnLostDevice();
     Sprite.OnLostDevice();
 }