示例#1
0
        void VB._dispVBProjectsEvents.ItemRenamed([MarshalAs(UnmanagedType.Interface), In] VB.VBProject VBProject,
                                                  [MarshalAs(UnmanagedType.BStr), In] string OldName)
        {
            var project = new VBProject(VBProject);

            if (!IsInDesignMode() || VBProject.Protection == VB.vbext_ProjectProtection.vbext_pp_locked)
            {
                project.Dispose();
                return;
            }

            var projectId = project.ProjectId;

            var handler = ProjectRenamed;

            if (handler == null || projectId == null)
            {
                project.Dispose();
                return;
            }
            handler.Invoke(project, new ProjectRenamedEventArgs(projectId, project, OldName));
        }
示例#2
0
        private void OnDispatch(EventHandler <ProjectEventArgs> dispatched, VB.VBProject vbProject, bool assignId = false)
        {
            var project = new VBProject(vbProject);
            var handler = dispatched;

            if (handler == null || !IsInDesignMode() || vbProject.Protection == VB.vbext_ProjectProtection.vbext_pp_locked)
            {
                project.Dispose();
                return;
            }

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

            if (projectId == null)
            {
                project.Dispose();
                return;
            }
            handler.Invoke(project, new ProjectEventArgs(projectId, project));
        }