Пример #1
0
        void ShowOverlay(string message, bool isActive)
        {
            int timeOut = Properties.Settings.Default.indDisplayTime;

            if (Application.OpenForms.OfType <IndicatorOverlay>().Any())
            {
                IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType <IndicatorOverlay>().First();
                indicatorOverlay.UpdateIndicator(
                    message
                    , timeOut
                    , isActive ? Properties.Settings.Default.indBgColourActive : Properties.Settings.Default.indBgColourInactive
                    , isActive ? Properties.Settings.Default.indFgColourActive : Properties.Settings.Default.indFgColourInactive
                    , isActive ? Properties.Settings.Default.indBdColourActive : Properties.Settings.Default.indBdColourInactive
                    , Properties.Settings.Default.indFont
                    , Properties.Settings.Default.overlayPosition
                    , Properties.Settings.Default.indOpacity
                    );
            }
            else
            {
                IndicatorOverlay indicatorOverlay = new IndicatorOverlay(
                    message
                    , timeOut
                    , isActive ? Properties.Settings.Default.indBgColourActive : Properties.Settings.Default.indBgColourInactive
                    , isActive ? Properties.Settings.Default.indFgColourActive : Properties.Settings.Default.indFgColourInactive
                    , isActive ? Properties.Settings.Default.indBdColourActive : Properties.Settings.Default.indBdColourInactive
                    , Properties.Settings.Default.indFont
                    , Properties.Settings.Default.overlayPosition
                    , Properties.Settings.Default.indOpacity
                    );
                indicatorOverlay.Show();
            }
        }
Пример #2
0
        void ShowOverlayInfo(string message)
        {
            int timeOut = SettingsManager.Get <int>("indDisplayTime");

            if (timeOut < 0)
            {
                timeOut = 2000;
            }
            var alwaysShow = false;

            if (Application.OpenForms.OfType <IndicatorOverlay>().Any() && Application.OpenForms.OfType <IndicatorOverlay>().Where(f => !f.IsDisposed).Any())
            {
                IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType <IndicatorOverlay>().Where(f => !f.IsDisposed).First();
                indicatorOverlay.UpdateIndicator(
                    message
                    , timeOut
                    , SettingsManager.Get <Color>("indBgColourInactive")
                    , SettingsManager.Get <Color>("indFgColourInactive")
                    , SettingsManager.Get <Color>("indFgColourInactive")
                    , SettingsManager.Get <int>("bdSize")
                    , SettingsManager.GetOrDefault <Font>("indFont")
                    , SettingsManager.Get <IndicatorDisplayPosition>("overlayPosition")
                    , SettingsManager.Get <int>("indOpacity")
                    , alwaysShow
                    );
            }
            else
            {
                IndicatorOverlay indicatorOverlay = new IndicatorOverlay(
                    message
                    , timeOut
                    , SettingsManager.Get <Color>("indBgColourInactive")
                    , SettingsManager.Get <Color>("indFgColourInactive")
                    , SettingsManager.Get <Color>("indFgColourInactive")
                    , SettingsManager.Get <int>("bdSize")
                    , SettingsManager.GetOrDefault <Font>("indFont")
                    , SettingsManager.Get <IndicatorDisplayPosition>("overlayPosition")
                    , SettingsManager.Get <int>("indOpacity")
                    , alwaysShow
                    );
            }
        }
Пример #3
0
        void ShowOverlay(string message, bool isActive)
        {
            int timeOut    = SettingsManager.Get <int>("indDisplayTime");
            var alwaysShow = SettingsManager.Get <bool>("alwaysShowWhenActive") && isActive;

            if (Application.OpenForms.OfType <IndicatorOverlay>().Any() && Application.OpenForms.OfType <IndicatorOverlay>().Where(f => !f.IsDisposed).Any())
            {
                IndicatorOverlay indicatorOverlay = Application.OpenForms.OfType <IndicatorOverlay>().Where(f => !f.IsDisposed).First();
                indicatorOverlay.UpdateIndicator(
                    message
                    , timeOut
                    , isActive ? SettingsManager.Get <Color>("indBgColourActive") : SettingsManager.Get <Color>("indBgColourInactive")
                    , isActive ? SettingsManager.Get <Color>("indFgColourActive") : SettingsManager.Get <Color>("indFgColourInactive")
                    , isActive ? SettingsManager.Get <Color>("indBdColourActive") : SettingsManager.Get <Color>("indBdColourInactive")
                    , SettingsManager.Get <int>("bdSize")
                    , SettingsManager.GetOrDefault <Font>("indFont")
                    , SettingsManager.Get <IndicatorDisplayPosition>("overlayPosition")
                    , SettingsManager.Get <int>("indOpacity")
                    , alwaysShow
                    );
            }
            else
            {
                IndicatorOverlay indicatorOverlay = new IndicatorOverlay(
                    message
                    , timeOut
                    , isActive ? SettingsManager.Get <Color>("indBgColourActive") : SettingsManager.Get <Color>("indBgColourInactive")
                    , isActive ? SettingsManager.Get <Color>("indFgColourActive") : SettingsManager.Get <Color>("indFgColourInactive")
                    , isActive ? SettingsManager.Get <Color>("indBdColourActive") : SettingsManager.Get <Color>("indBdColourInactive")
                    , SettingsManager.Get <int>("bdSize")
                    , SettingsManager.GetOrDefault <Font>("indFont")
                    , SettingsManager.Get <IndicatorDisplayPosition>("overlayPosition")
                    , SettingsManager.Get <int>("indOpacity")
                    , alwaysShow
                    );
                indicatorOverlay.Show();
            }
        }