コード例 #1
0
ファイル: CheckStringTest.cs プロジェクト: alibad/Bugger
        public void PropertiesWithNotification()
        {
            CheckString checkString = new CheckString("High");

            Assert.IsFalse(checkString.IsChecked);
            AssertHelper.PropertyChangedEvent(checkString, x => x.IsChecked, () => checkString.IsChecked = true);
            Assert.IsTrue(checkString.IsChecked);
        }
コード例 #2
0
ファイル: CheckStringTest.cs プロジェクト: alibad/Bugger
        public void GeneralCheckStringTest()
        {
            CheckString checkString = new CheckString("High");
            Assert.AreEqual("High", checkString.Name);
            Assert.IsFalse(checkString.IsChecked);

            checkString.IsChecked = true;
            Assert.IsTrue(checkString.IsChecked);
        }
コード例 #3
0
ファイル: TFSProxy.cs プロジェクト: alibad/Bugger
        private void UpdateSettingDialogPriorityValues()
        {
            foreach (var checkString in this.settingViewModel.PriorityValues)
            {
                RemoveWeakEventListener(checkString, PriorityValuePropertyChanged);
            }
            this.settingViewModel.PriorityValues.Clear();

            string fieldName = this.settingViewModel.PropertyMappingCollection["Priority"];
            if (string.IsNullOrWhiteSpace(fieldName))
            {
                this.settingViewModel.PriorityRed = string.Empty;
                return;
            }

            TFSField priorityField = this.settingViewModel.TFSFields.FirstOrDefault(x => x.Name == fieldName);
            if (priorityField == null) { return; }

            foreach (var value in priorityField.AllowedValues)
            {
                CheckString checkValue = new CheckString(value);
                checkValue.IsChecked = !string.IsNullOrWhiteSpace(this.document.PriorityRed)
                                       && this.document.PriorityRed.Contains(value);

                AddWeakEventListener(checkValue, PriorityValuePropertyChanged);

                this.settingViewModel.PriorityValues.Add(checkValue);
            }

            this.settingViewModel.PriorityRed = string.Join(PriorityRedSeparator,
                                                            this.settingViewModel.PriorityValues
                                                                                 .Where(x => x.IsChecked)
                                                                                 .Select(x => x.Name));
        }