Beispiel #1
0
        private void OnDispatch(EventHandler <ProjectEventArgs> dispatched, VB.VBProject vbProject, bool assignId = false)
        {
            var project = new VBProject(vbProject);

            var handler = dispatched;

            if (handler == null || !VBE.IsInDesignMode)
            {
                project.Dispose();
                return;
            }

            if (assignId)
            {
                project.AssignProjectId();
            }
            var projectId = project.ProjectId;

            handler.Invoke(this, new ProjectEventArgs(projectId, project));
        }
Beispiel #2
0
        private void OnProjectRenamed(VB.VBProject vbProject, string oldName)
        {
            var project = new VBProject(vbProject);

            if (!VBE.IsInDesignMode)
            {
                project.Dispose();
                return;
            }

            var projectId = project.ProjectId;

            var handler = ProjectRenamed;

            if (handler == null)
            {
                project.Dispose();
                return;
            }

            handler.Invoke(this, new ProjectRenamedEventArgs(projectId, project, oldName));
        }
Beispiel #3
0
 private void OnProjectActivated(VB.VBProject vbProject)
 {
     OnDispatch(ProjectActivated, vbProject);
 }
Beispiel #4
0
 private void OnProjectRemoved(VB.VBProject vbProject)
 {
     OnDispatch(ProjectRemoved, vbProject);
 }
Beispiel #5
0
 private void OnProjectAdded(VB.VBProject vbProject)
 {
     OnDispatch(ProjectAdded, vbProject, true);
 }