Пример #1
0
 public static void ShowForm(SirenOfShameSettings settings, AchievementLookup achievement, PersonSetting person, IWin32Window owner, bool modal)
 {
     var newAchievement = new NewAchievement(settings, achievement, person);
     if (modal)
     {
         newAchievement.ShowDialog(owner);
     }
     else
     {
         newAchievement.Show(owner);
     }
 }
Пример #2
0
        private NewAchievement(SirenOfShameSettings settings, AchievementLookup achievement, PersonSetting person)
        {
            _achievement = achievement;
            _settings = settings;

            InitializeComponent();

            _user.Text = person.DisplayName;
            _title.Text = achievement.Name + "!";
            _accomplishment.Text = achievement.Description;

            if (_settings.AchievementAlertPreference == AchievementAlertPreferenceEnum.Always)
            {
                _alwaysShowNewAchievements.Checked = true;
            }
            if (_settings.AchievementAlertPreference == AchievementAlertPreferenceEnum.Never)
            {
                _neverShowAchievements.Checked = true;
            }
            if (_settings.AchievementAlertPreference == AchievementAlertPreferenceEnum.OnlyForMe)
            {
                _onlyShowMyAchievements.Checked = true;
            }

            _userIAm.Items.Add("");
            foreach (var personInProject in _settings.People)
            {
                _userIAm.Items.Add(personInProject);
            }
            if (!string.IsNullOrEmpty(_settings.MyRawName))
            {
                foreach (var item in _userIAm.Items)
                {
                    var personSetting = item as PersonSetting;
                    if (personSetting != null && personSetting.RawName == _settings.MyRawName)
                    {
                        _userIAm.SelectedItem = item;
                    }
                }
            }
        }