Esempio n. 1
0
        private void _attributes_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
            {
                var attributes = new Collection <MetaAttribute>();
                foreach (MetaAttribute attribute in e.NewItems)
                {
                    attributes.Add(attribute);
                }

                var args = new TestAttributesCommandArgs(attributes);

                TestCommandsSource.RaiseOnAddTestAttributes(_commandsSource, _testContext, args);
            }
            else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
            {
                var attributes = new Collection <MetaAttribute>();
                foreach (MetaAttribute attribute in e.OldItems)
                {
                    attributes.Add(attribute);
                }

                var args = new TestAttributesCommandArgs(attributes);

                TestCommandsSource.RaiseOnRemoveTestAttributes(_commandsSource, _testContext, args);
            }
        }
Esempio n. 2
0
        public MetaAttributesCollection(ITestContext testContext, TestCommandsSource commandsSource)
        {
            _testContext    = testContext;
            _commandsSource = commandsSource;

            var commandArgs = new TestAttributesCommandArgs(null);

            TestCommandsSource.RaiseOnGetTestAttributes(_commandsSource, _testContext, commandArgs);

            _attributes = new ObservableCollection <MetaAttribute>(commandArgs.Attributes);

            _attributes.CollectionChanged += _attributes_CollectionChanged;
        }
Esempio n. 3
0
 public TestMetadataEmitter(ITestContext testContext, TestCommandsSource commandsSource)
 {
     _testContext    = testContext;
     _commandsSource = commandsSource;
 }