예제 #1
0
        public static void SetFont(string family, float size)
        {
            FontFamily   = family;
            FontBaseSize = size;

            FontChanged?.Invoke(null, EventArgs.Empty);
        }
예제 #2
0
파일: Fonts.cs 프로젝트: vileelf/botterino
        static Fonts()
        {
            AppSettings.FontChanged += (s, e) =>
            {
                gdiInitialized = false;
                dwInitialized  = false;

                FontChanged?.Invoke(null, EventArgs.Empty);
            };
        }
예제 #3
0
파일: MirLabel.cs 프로젝트: vjhlv/mir2
        private void OnFontChanged(EventArgs e)
        {
            TextureValid = false;

            GetSize();

            if (FontChanged != null)
            {
                FontChanged.Invoke(this, e);
            }
        }
예제 #4
0
        /// <summary>
        /// Default class constructor.
        /// </summary>
        public Settings()
        {
            _service = DependencyService.Get <ISettings>();

            _service.LocaleChanged       += (s, e) => { LocaleChanged?.Invoke(s, e); };
            _service.UserSettingsChanged += (s, e) => { UserSettingsChanged?.Invoke(s, e); };
            _service.FontChanged         += (s, e) => { FontChanged?.Invoke(s, e); };
            _service.SoundChanged        += (s, e) => { SoundChanged?.Invoke(s, e); };
            _service.OtherChanged        += (s, e) => { OtherChanged?.Invoke(s, e); };

            _service.StartListening();
        }
예제 #5
0
        private void OnFontChanged(EventArgs e)
        {
            TextureValid = false;

            if (DXFont != null && !DXFont.Disposed)
            {
                DXFont.Dispose();
            }

            if (Font != null)
            {
                DXFont = new Microsoft.DirectX.Direct3D.Font(DXManager.Device, Font);
            }

            if (FontChanged != null)
            {
                FontChanged.Invoke(this, e);
            }
        }
예제 #6
0
        private void AggregateFont()
        {
            compareFont.Family = Aggregate(p => p.FontFace);
            compareFont.Color  = Aggregate(p => p.TextColor);
            compareFont.Style  = Aggregate(p => p.FontStyle);
            compareFont.Size   = Aggregate(p => p.FontSize);

            if (compareFont.IsEmpty)
            {
                font = new Font(display.ParentFont);
            }
            else if (!compareFont.Equals(fontProperties) || ParentFontChanged())
            {
                Swap(ref fontProperties, ref compareFont);

                if (string.IsNullOrWhiteSpace(fontProperties.Family))
                {
                    font = new Font(display.ParentFont);
                }
                else if (display.Fonts.HasFont(fontProperties.Family) &&
                         !fontProperties.Family.Equals(Font?.Name, StringComparison.OrdinalIgnoreCase))
                {
                    font = new Font(display.Fonts[fontProperties.Family]);
                }
                else if (Font == null)
                {
                    font = new Font(display.ParentFont);
                }

                font.Color = fontProperties.Color ?? display.ParentFont?.Color ?? Font.Color;
                font.Style = fontProperties.Style ?? display.ParentFont?.Style ?? Font.Style;
                font.Size  = fontProperties.Size ?? display.ParentFont?.Size ?? Font.Size;
            }

            parentFontProperties.CopyFrom(display.ParentFont);

            FontChanged?.Invoke();
        }
예제 #7
0
파일: Settings.cs 프로젝트: Kaszub09/Snake
 static public void ChangeFont(FontSize fontSize)
 {
     FontChanged?.Invoke(null, null);
 }
예제 #8
0
 /// <summary>
 /// Raises XamlChanged event notifying Noesis that it should reload the specified xaml
 /// </summary>
 public void RaiseFontChanged(Uri baseUri, string familyName, FontWeight weight,
                              FontStretch stretch, FontStyle style)
 {
     FontChanged?.Invoke(baseUri, familyName, weight, stretch, style);
     Noesis_RaiseFontChanged(swigCPtr, baseUri.OriginalString, familyName, (int)weight, (int)stretch, (int)style);
 }
예제 #9
0
 public void SendFontChanged()
 {
     FontChanged?.Invoke(this, EventArgs.Empty);
 }
예제 #10
0
 protected virtual void OnFontChanged()
 {
     FontChanged?.Invoke(this);
 }
예제 #11
0
 protected virtual void OnFontChanged(EventArgs e) => FontChanged?.Invoke(this, e);
예제 #12
0
 /// <summary>
 /// Invoke FontChanged event
 /// </summary>
 /// <param name="target">Type of element of this font (homework, test, subject)</param>
 /// <param name="font">New font</param>
 internal static void Call_FontChanged(FontTarget target, FontGroup font)
 {
     FontChanged?.Invoke(target, font);
 }
예제 #13
0
파일: Text.cs 프로젝트: emhean/Seraf
 private void OnFontChanged(EventArgs e) => FontChanged?.Invoke(this, e);
예제 #14
0
 /// <summary>
 /// Raises the <see cref="FontChanged"/> event.
 /// </summary>
 protected virtual void OnFontChanged(FontPicker sender, EventArgs e) => FontChanged?.Invoke(sender, e);
예제 #15
0
 /// <summary>
 /// Invoked on font size change.
 /// </summary>
 /// <param name="s">Object that sent event.</param>
 /// <param name="e">Event parameters.</param>
 private void OnFontSizeChanged(object s, FontSizeChangedEventArgs e)
 {
     FontChanged?.Invoke(s, new EventArgs());
 }
예제 #16
0
 /// <summary>
 /// Raises the <see cref="FontChanged"/> event.
 /// </summary>
 protected virtual void OnFontChanged(FontPicker sender) => FontChanged?.Invoke(sender);
        /// <summary>
        /// Starts observing system settings for changes.
        /// </summary>
        /// <remarks>
        /// System settings events will be never invoked before calling this method.
        /// </remarks>
        public void StartListening()
        {
            SystemSettings.LocaleCountryChanged +=
                (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.LocaleLanguageChanged +=
                (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.LocaleTimeFormat24HourSettingChanged +=
                (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.LocaleTimeZoneChanged +=
                (s, e) => { LocaleChanged?.Invoke(s, new EventArgs()); };

            try
            {
                SystemSettings.IncomingCallRingtoneChanged +=
                    (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); };
            }
            catch (NotSupportedException e)
            {
                Log.Warn("SystemInfo", e.Message);
            }

            try
            {
                SystemSettings.EmailAlertRingtoneChanged +=
                    (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); };
            }
            catch (NotSupportedException e)
            {
                Log.Warn("SystemInfo", e.Message);
            }

            try
            {
                SystemSettings.WallpaperHomeScreenChanged +=
                    (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); };
            }
            catch (NotSupportedException e)
            {
                Log.Warn("SystemInfo", e.Message);
            }

            try
            {
                SystemSettings.WallpaperLockScreenChanged +=
                    (s, e) => { UserSettingsChanged?.Invoke(s, new EventArgs()); };
            }
            catch (NotSupportedException e)
            {
                Log.Warn("SystemInfo", e.Message);
            }

            SystemSettings.FontSizeChanged += (s, e) => { FontChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.FontTypeChanged += (s, e) => { FontChanged?.Invoke(s, new EventArgs()); };

            SystemSettings.SoundLockSettingChanged +=
                (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.SoundSilentModeSettingChanged +=
                (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.SoundTouchSettingChanged +=
                (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.SoundNotificationRepetitionPeriodChanged +=
                (s, e) => { SoundChanged?.Invoke(s, new EventArgs()); };

            SystemSettings.DeviceNameChanged    += (s, e) => { OtherChanged?.Invoke(s, new EventArgs()); };
            SystemSettings.MotionSettingChanged += (s, e) => { OtherChanged?.Invoke(s, new EventArgs()); };
        }
예제 #18
0
파일: Fonts.cs 프로젝트: vileelf/botterino
 public static void SetFont(string family, float baseSize)
 {
     FontChanged?.Invoke(null, EventArgs.Empty);
 }