예제 #1
0
		void ProjectItemsEvents_ItemRenamed(ProjectItem projectItem, string oldName)
		{
			if (projectItem.WasJiss(oldName))
			{
				// renamed from jiss file to something else (could still be jiss file but with another name)
				_core.Unload(projectItem);
			}

			if (projectItem.IsJiss())
			{
				// If renamed to jiss file
				_core.Load(projectItem);
			}

			// What if it WasJiss ? should it then execute before Unload ? The jiss file being unloaded could be listning to rename of it self ? ... who cares ...

			var project = projectItem.ContainingProject;
			_core.Execute(project, x => x.ProjectItemRenamed(projectItem, oldName));
		}