Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void GeneralCheckStringTest()
        {
            CheckString checkString = new CheckString("High");
            Assert.AreEqual("High", checkString.Name);
            Assert.IsFalse(checkString.IsChecked);

            checkString.IsChecked = true;
            Assert.IsTrue(checkString.IsChecked);
        }
Ejemplo n.º 3
0
        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));
        }