/*
 * Copyright 2013-2014 must-be.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.mustbe.consulo.csharp.ide.reflactoring.rename;

import org.mustbe.consulo.csharp.lang.psi.impl.source.CSharpFileImpl;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.util.Condition;
import com.intellij.psi.PsiElement;

/**
 * @author VISTALL
 * @since 15.05.14
 */
public class CSharpVetoRenameCondition implements Condition<PsiElement>
{
	@Override
	public boolean value(PsiElement psiElement)
	{
		if(psiElement instanceof CSharpFileImpl)
		{
			Module moduleForPsiElement = ModuleUtilCore.findModuleForPsiElement(psiElement);
			if(moduleForPsiElement != null)
			{
				return true;
			}
		}
		return false;
	}
}

@@ -731,40 +731,78 @@
 ort 
-com.intellij.openapi.module.Modu
+org.mustbe.consulo.msil.representation.MsilFileRepresentationVirtualFi
 le;%0A
@@ -833,29 +833,22 @@
 api.
-module.ModuleUtilCore
+util.Condition
 ;%0Aim
@@ -869,38 +869,39 @@
 lij.openapi.
-util.Condition
+vfs.VirtualFile
 ;%0Aimport com
@@ -1160,150 +1160,149 @@
 %0A%09%09%09
-Module moduleForPsiElement = ModuleUtilCore.findModuleForPsiElement(psiElement);%0A%09%09%09if(moduleForPsiElement != null)%0A%09%09%09%7B%0A%09%09%09%09return true;%0A%09%09%09%7D
+VirtualFile virtualFile = ((CSharpFileImpl) psiElement).getVirtualFile();%0A%09%09%09return virtualFile instanceof MsilFileRepresentationVirtualFile;
 %0A%09%09%7D

fix file rename