/// <summary> /// Creates IRenameStrategy by elementType. /// </summary> /// <param name="elementType">Type of CodeElement.</param> /// <returns>IRenameStrategy implementation.</returns> public static IRenameStrategy Create(vsCMElement elementType) { IRenameStrategy result = null; switch (elementType) { case vsCMElement.vsCMElementFunctionInvokeStmt: case vsCMElement.vsCMElementFunction: { result = new FunctionRenameStrategy(); break; } case vsCMElement.vsCMElementVariable: case vsCMElement.vsCMElementMap: case vsCMElement.vsCMElementLocalDeclStmt: case vsCMElement.vsCMElementDefineStmt: case vsCMElement.vsCMElementDeclareDecl: { result = new VariableRenameStrategy(); break; } } return result; }
/// <summary> /// Creates IRenameStrategy by elementType. /// </summary> /// <param name="elementType">Type of CodeElement.</param> /// <returns>IRenameStrategy implementation.</returns> public static IRenameStrategy Create(vsCMElement elementType) { IRenameStrategy result = null; switch (elementType) { case vsCMElement.vsCMElementFunctionInvokeStmt: case vsCMElement.vsCMElementFunction: { result = new FunctionRenameStrategy(); break; } case vsCMElement.vsCMElementVariable: case vsCMElement.vsCMElementMap: case vsCMElement.vsCMElementLocalDeclStmt: case vsCMElement.vsCMElementDefineStmt: case vsCMElement.vsCMElementDeclareDecl: { result = new VariableRenameStrategy(); break; } } return(result); }