示例#1
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 (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;
            }
        }
示例#2
0
 /// <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();
 }
示例#3
0
        private void Drawing_OnPreReset(EventArgs args)
        {
            if (Font == null || Font.IsDisposed)
            {
                return;
            }

            Dispose();
            Font?.OnLostDevice();
        }
示例#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;
             * }
             */
        }
示例#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(); };
        }
示例#6
0
        /// <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(); };
        }
示例#7
0
 static void Drawing_OnPreReset(EventArgs args)
 {
     S.OnLostDevice();
     RecF.OnLostDevice();
 }
示例#8
0
 void Drawing_OnPreReset(EventArgs args)
 {
     Text.OnLostDevice();
 }
示例#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(); };
        }
示例#10
0
 private static void DrawingOnOnPreReset(EventArgs args)
 {
     Text.OnLostDevice();
     TextLittle.OnLostDevice();
 }
示例#11
0
 private void Drawing_OnPreReset(EventArgs args)
 {
     Dispose();
     Font?.OnLostDevice();
 }
示例#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();
 }
示例#13
0
文件: SF.cs 项目: aleksanmer/SFKEY
 private static void Drawing_OnPreReset(EventArgs args)
 {
     text.OnLostDevice();
 }
示例#14
0
 private static void DrawingOnOnPreReset(EventArgs args)
 {
     TextStatus.OnLostDevice();
 }
示例#15
0
 private static void DrawingOnPreReset(EventArgs args)
 {
     //Game.PrintChat("DrawingOnPreReset");
     Text.OnLostDevice();
     Sprite.OnLostDevice();
 }