コード例 #1
0
        public Settings()
        {
            //Loading pop-up interval from saved properties
            _interval = new IntervalOption("Pop-ups interval", getInterval());
            _notify   = new NotifyOption("Notification", getNotifyState());
            _vibrate  = new VibrateOption("Vibrate", getVibrateState());
            _timer    = new TimerOption("Timer", _interval.TimePeriod);
            // TODO: ADDING NEW OPTION: creating object

            _updateTimerValue = new UpdateTimerValue(OnPropertyChanged);
        }
コード例 #2
0
        private NotifyOption ThreeOptionMessage(MessageBoxImage image, string message, string title, NotifyOption firstOption, NotifyOption secondOption, NotifyOption thirdOption)
        {
            NotifyOption result = default;

            // Set the button text
            Style style = new Style();

            style.Setters.Add(new Setter(MessageBox.YesButtonContentProperty, firstOption.Text));
            style.Setters.Add(new Setter(MessageBox.NoButtonContentProperty, secondOption.Text));
            style.Setters.Add(new Setter(MessageBox.CancelButtonContentProperty, thirdOption.Text));

            // Add descriptions as tooltips, if given
            if (string.IsNullOrEmpty(firstOption.Description) == false)
            {
                Style firstButtonStyle = new Style();
                firstButtonStyle.Setters.Add(new Setter(FrameworkElement.ToolTipProperty, firstOption.Description));
                style.Setters.Add(new Setter(MessageBox.YesButtonStyleProperty, firstButtonStyle));
            }

            if (string.IsNullOrEmpty(secondOption.Description) == false)
            {
                Style secondButtonStyle = new Style();
                secondButtonStyle.Setters.Add(new Setter(FrameworkElement.ToolTipProperty, secondOption.Description));
                style.Setters.Add(new Setter(MessageBox.NoButtonStyleProperty, secondButtonStyle));
            }

            if (string.IsNullOrEmpty(thirdOption.Description) == false)
            {
                Style thirdButtonStyle = new Style();
                thirdButtonStyle.Setters.Add(new Setter(FrameworkElement.ToolTipProperty, thirdOption.Description));
                style.Setters.Add(new Setter(MessageBox.CancelButtonStyleProperty, thirdButtonStyle));
            }

            switch (MessageBox.Show(message, title, MessageBoxButton.YesNoCancel, image, style))
            {
            case MessageBoxResult.Yes:
                result = firstOption;
                break;

            case MessageBoxResult.No:
                result = secondOption;
                break;

            case MessageBoxResult.Cancel:
                result = thirdOption;
                break;
            }

            return(result);
        }
コード例 #3
0
 public HunterConfig()
 {
     StrategyFolder      = HunterUtilities.AbsolutePath("strategy\\");
     PluginFolder        = HunterUtilities.AbsolutePath("plugins\\");
     CurrentStrategyFile = HunterUtilities.AbsolutePath("strategy\\bing.h3s");
     UseProxy            = false;
     PingTimeout         = 3000;
     viewOption          = new ViewOption();
     notifyOption        = new NotifyOption();
     ProxyFilterKeywords = new List <String>();
     UpdateHTTPRoot      = "http://10.20.128.164:1204";
     UpdateHTTPIndex     = "/download/version.xml";
     FailureCooldown     = 60;
     FailureTimes        = 10;
     HunterCore          = Core.Default;
 }
コード例 #4
0
 public NotifyOption Warning(string message, string title, NotifyOption firstOption, NotifyOption secondOption, NotifyOption thirdOption)
 {
     return(ThreeOptionMessage(MessageBoxImage.Warning, message, title, firstOption, secondOption, thirdOption));
 }
コード例 #5
0
 public NotifyOption Information(string message, string title, NotifyOption firstOption, NotifyOption secondOption)
 {
     return(TwoOptionMessage(MessageBoxImage.Information, message, title, firstOption, secondOption));
 }