コード例 #1
0
        internal void RemoveContext(object context)
        {
            bool removed = false;

            lock (_contexts) {
                removed = _contexts.Remove(context);
            }
            if (removed)
            {
                ProjectsChanaged?.Invoke(this, EventArgs.Empty);
            }
        }
コード例 #2
0
        public void AddContext(object context)
        {
            bool added = false;

            lock (_contexts) {
                added = _contexts.Add(context);
            }
            if (added)
            {
                ProjectsChanaged?.Invoke(this, EventArgs.Empty);
            }
        }
コード例 #3
0
        public void UpdateProject(PythonProjectNode node, MSBuild.Project project)
        {
            lock (_projects) {
                if (project == null)
                {
                    _projects.Remove(node);
                }
                else if (!_projects.ContainsKey(node) || _projects[node] != project)
                {
                    _projects[node] = project;
                }
            }

            // Always raise the event, this also occurs when we're adding projects
            // to the MSBuild.Project.
            ProjectsChanaged?.Invoke(this, EventArgs.Empty);
        }