Esempio n. 1
0
        private void BindingFilesTrackerOnFileUpdated(BindingFileInfo bindingFileInfo)
        {
            bool isChanged = false;

            List <IStepDefinitionBinding> bindings;

            if (bindingSuggestions.TryGetValue(bindingFileInfo, out bindings))
            {
                bindings.ForEach(RemoveBinding);
                bindings.Clear();
                isChanged = true;
            }

            if (!bindingFileInfo.IsError && bindingFileInfo.StepBindings.Any())
            {
                if (bindings == null)
                {
                    bindings = new List <IStepDefinitionBinding>();
                    bindingSuggestions.Add(bindingFileInfo, bindings);
                }

                bindings.AddRange(bindingFileInfo.StepBindings);
                bindings.ForEach(AddBinding);
                isChanged = true;
            }

            if (isChanged)
            {
                FireBindingsChanged();
            }
        }
Esempio n. 2
0
        private void BindingFilesTrackerOnFileRemoved(BindingFileInfo bindingFileInfo)
        {
            List <IStepDefinitionBinding> bindings;

            if (bindingSuggestions.TryGetValue(bindingFileInfo, out bindings))
            {
                bindings.ForEach(RemoveBinding);
                bindingSuggestions.Remove(bindingFileInfo);

                FireBindingsChanged();
            }
        }